Catch exception when shutting down taskpool

This commit is contained in:
Arnaud 2025-09-09 20:31:16 +02:00 committed by Eric
parent e784eaea8e
commit b41177574e
No known key found for this signature in database

View File

@ -195,7 +195,11 @@ proc stop*(s: CodexServer) {.async.} =
raiseAssert "Failed to stop codex node"
if not s.taskpool.isNil:
s.taskpool.shutdown()
try:
s.taskpool.shutdown()
except Exception as exc:
error "Failed to stop the taskpool", failures = res.failure.len
raiseAssert("Failure in taskpool shutdown:" & exc.msg)
proc new*(
T: type CodexServer, config: CodexConf, privateKey: CodexPrivateKey