fix(question): clean up pending entry on abort (#17533)
This commit is contained in:
@@ -129,7 +129,12 @@ export class QuestionService extends ServiceMap.Service<QuestionService, Questio
|
|||||||
pending.set(id, { info, deferred })
|
pending.set(id, { info, deferred })
|
||||||
Bus.publish(Event.Asked, info)
|
Bus.publish(Event.Asked, info)
|
||||||
|
|
||||||
return yield* Deferred.await(deferred)
|
return yield* Effect.ensuring(
|
||||||
|
Deferred.await(deferred),
|
||||||
|
Effect.sync(() => {
|
||||||
|
pending.delete(id)
|
||||||
|
}),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const reply = Effect.fn("QuestionService.reply")(function* (input: { requestID: QuestionID; answers: Answer[] }) {
|
const reply = Effect.fn("QuestionService.reply")(function* (input: { requestID: QuestionID; answers: Answer[] }) {
|
||||||
|
|||||||
Reference in New Issue
Block a user