Skip to content

Commit

Permalink
wrap in try block to ensure cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yushih committed Apr 22, 2022
1 parent 29042fa commit d87eeab
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,13 @@ export default class TransactionsStore extends Store<StoresMap, ActionsMap> {
if (this.ongoingRefreshing.has(publicDeriverId)) {
return this.ongoingRefreshing.get(publicDeriverId);
} else {
const promise = this._refreshTransactionData(request);
this.ongoingRefreshing.set(publicDeriverId, promise);
await promise;
this.ongoingRefreshing.delete(publicDeriverId);
try {
const promise = this._refreshTransactionData(request);
this.ongoingRefreshing.set(publicDeriverId, promise);
await promise;
} finally {
this.ongoingRefreshing.delete(publicDeriverId);
}
}
}

Expand Down

0 comments on commit d87eeab

Please sign in to comment.