diff --git a/codex/stores/maintenance.nim b/codex/stores/maintenance.nim index 38486239..b2fece4d 100644 --- a/codex/stores/maintenance.nim +++ b/codex/stores/maintenance.nim @@ -100,12 +100,13 @@ proc runBlockCheck( trace "Cycle completed" proc start*(self: BlockMaintainer) = - proc onTimer(): Future[void] {.async: (raises: []).} = + proc onTimer(): Future[void] {.async: (raises: [CancelledError]).} = try: await self.runBlockCheck() except CancelledError as err: trace "Running block check in block maintenance timer callback cancelled: ", err = err.msg + raise err self.timer.start(onTimer, self.interval) diff --git a/codex/utils/timer.nim b/codex/utils/timer.nim index fc22dfd3..f12b1228 100644 --- a/codex/utils/timer.nim +++ b/codex/utils/timer.nim @@ -17,7 +17,7 @@ import pkg/chronos import ../logutils type - TimerCallback* = proc(): Future[void] {.async: (raises: []).} + TimerCallback* = proc(): Future[void] {.async: (raises: [CancelledError]).} Timer* = ref object of RootObj callback: TimerCallback interval: Duration