diff --git a/trustgraph-flow/trustgraph/librarian/service.py b/trustgraph-flow/trustgraph/librarian/service.py index 2e73e6f8..705494fd 100755 --- a/trustgraph-flow/trustgraph/librarian/service.py +++ b/trustgraph-flow/trustgraph/librarian/service.py @@ -450,14 +450,11 @@ class Processor(WorkspaceProcessor): self.pubsub, q, schema=schema ) - await pub.start() - - # FIXME: Time wait kludge? - await asyncio.sleep(1) - - await pub.send(None, doc) - - await pub.stop() + try: + await pub.start() + await pub.send(None, doc) + finally: + await pub.stop() logger.debug("Document submitted")