Skip to content

Commit

Permalink
Fix issue when reloading while a reload is pending.
Browse files Browse the repository at this point in the history
I noticed of an issue with the `MULTI_THREAD` feature, where an
application would receive a `CancellationError` in the very rare
(possible right now?) occurrence where we're reloading while a reload
operation is already pending.

We don't ever want to leak `CancellationError` which is just an internal
mechanism. I thought that we can just ignore that one.
  • Loading branch information
peaBerberian committed Sep 3, 2024
1 parent 8724077 commit 96bf1c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/main/worker/worker_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,10 @@ function loadOrReloadPreparedContent(
);
},
(err: unknown) => {
if (TaskCanceller.isCancellationError(err)) {
log.info("WP: A reloading operation was cancelled");
return;
}
sendMessage({
type: WorkerMessageType.Error,
contentId,
Expand Down

0 comments on commit 96bf1c5

Please sign in to comment.