- Reduce back-pressure on tg-load-kg-core (#179)

- Save entity in correct format in tg-save-core
This commit is contained in:
cybermaggedon 2024-11-27 17:24:27 +00:00 committed by GitHub
parent 99e3e43f7b
commit 2f7ccb2ef8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -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(

View file

@ -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: