Skip to content

Commit bdef6fe

Browse files
committed
Add cache busting to worker URL.
1 parent c6f9499 commit bdef6fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/runner.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import { WorkerToHostMessage } from './proto';
22

3+
const workerURL = `app.worker.js?hash=${globalThis.GIT_COMMIT.substr(0, 8)}`;
4+
35
export class PythonError extends Error {}
46

57
export class ToolRunner {
6-
#worker = new Worker('app.worker.js', { type: 'module' });
8+
#worker = new Worker(workerURL, { type: 'module' });
79
#packages: null | string[] = null;
810

911
private initializeWorker(packages: string[]): Worker {
1012
if (JSON.stringify(this.#packages) !== JSON.stringify(packages)) {
1113
if (this.#worker !== null && this.#packages !== null) {
1214
// Terminate and re-initialize if the set of packages has changed.
1315
this.#worker.terminate();
14-
this.#worker = new Worker('app.worker.js', { type: 'module' });
16+
this.#worker = new Worker(workerURL, { type: 'module' });
1517
}
1618
this.#worker.postMessage({ type: 'loadPackages', pkgs: packages });
1719
this.#packages = packages;

0 commit comments

Comments
 (0)