[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix #8489
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix #8489 |
Date: |
Tue, 12 Mar 2024 12:11:05 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 0b8b9950d fix #8489
0b8b9950d is described below
commit 0b8b9950d003e215399886a6611212d4b2666166
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Mar 12 08:11:00 2024 -0300
fix #8489
---
packages/taler-util/src/observability.ts | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/packages/taler-util/src/observability.ts
b/packages/taler-util/src/observability.ts
index f40967c52..70391cbcd 100644
--- a/packages/taler-util/src/observability.ts
+++ b/packages/taler-util/src/observability.ts
@@ -38,14 +38,14 @@ export interface ObservabilityContext {
let seqId = 1000;
export class ObservableHttpClientLibrary implements HttpRequestLibrary {
- private readonly currentRequest = new Map<string,
CancellationToken.Source>();
+ private readonly cancelatorById = new Map<string,
CancellationToken.Source>();
constructor(
private impl: HttpRequestLibrary,
private oc: ObservabilityContext,
) {}
- public cancelRequest(id: string) {
- const cancelator = this.currentRequest.get(id);
+ public cancelRequest(id: string): void {
+ const cancelator = this.cancelatorById.get(id);
if (!cancelator) return;
cancelator.cancel();
}
@@ -61,7 +61,7 @@ export class ObservableHttpClientLibrary implements
HttpRequestLibrary {
if (opt?.cancellationToken) {
opt.cancellationToken.onCancelled(cancelator.cancel);
}
- this.currentRequest.set(id, cancelator);
+ this.cancelatorById.set(id, cancelator);
this.oc.observe({
id,
@@ -91,6 +91,8 @@ export class ObservableHttpClientLibrary implements
HttpRequestLibrary {
error: getErrorDetailFromException(e),
});
throw e;
+ } finally {
+ this.cancelatorById.delete(id)
}
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.