Skip to content

Commit

Permalink
- Reduce back-pressure on tg-load-kg-core (#179)
Browse files Browse the repository at this point in the history
- Save entity in correct format in tg-save-core
  • Loading branch information
cybermaggedon authored Nov 27, 2024
1 parent 99e3e43 commit 2f7ccb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions trustgraph-cli/scripts/tg-load-kg-core
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ async def loader(ge_queue, t_queue, path, format, user, collection):

async def run(**args):

ge_q = asyncio.Queue()
t_q = asyncio.Queue()
# Maxsize on queues reduces back-pressure so tg-load-kg-core doesn't
# grow to eat all memory
ge_q = asyncio.Queue(maxsize=500)
t_q = asyncio.Queue(maxsize=500)

load_task = asyncio.create_task(
loader(
Expand Down
2 changes: 1 addition & 1 deletion trustgraph-flow/trustgraph/api/gateway/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def serialize_graph_embeddings(message):
"collection": message.metadata.collection,
},
"vectors": message.vectors,
"entity": message.entity.value,
"entity": message.entity,
}

class Api:
Expand Down

0 comments on commit 2f7ccb2

Please sign in to comment.