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 4, 2024
1 parent 683b02e commit 1ce1608
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 1ce1608

Please sign in to comment.