From 53003618cbc1b7e9a59f990e5bc2489c1a59fb9a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 22 May 2023 00:16:58 -0400 Subject: [PATCH] Add longer timeout on brokerd ctx cancel; seems to work? --- piker/accounting/cli.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/piker/accounting/cli.py b/piker/accounting/cli.py index 5cdd4a58..76cbc1ab 100644 --- a/piker/accounting/cli.py +++ b/piker/accounting/cli.py @@ -209,7 +209,14 @@ def sync( ) console.print(summary) - await brokerd_ctx.cancel() + + # exit via ctx cancellation. + await brokerd_ctx.cancel(timeout=1) + # TODO: once ported to newer tractor branch we should + # be able to do a loop like this: + # while brokerd_ctx.cancel_called_remote is None: + # await trio.sleep(0.01) + # await brokerd_ctx.cancel() await portal.cancel_actor()