Skip to content

Commit ffbbee0

Browse files
fix(purchasing): fix crash completing future more than once (#1249)
1 parent 2dd436b commit ffbbee0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codex/purchasing/states/submitted.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ method run*(
3030
requestId = purchase.requestId
3131

3232
proc wait() {.async.} =
33-
let done = newFuture[void]()
33+
let done = newAsyncEvent()
3434
proc callback(_: RequestId) =
35-
done.complete()
35+
done.fire()
3636

3737
let subscription = await market.subscribeFulfillment(request.id, callback)
38-
await done
38+
await done.wait()
3939
await subscription.unsubscribe()
4040

4141
proc withTimeout(future: Future[void]) {.async.} =

0 commit comments

Comments
 (0)