File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { WorkerToHostMessage } from './proto' ;
2
2
3
+ const workerURL = `app.worker.js?hash=${ globalThis . GIT_COMMIT . substr ( 0 , 8 ) } ` ;
4
+
3
5
export class PythonError extends Error { }
4
6
5
7
export class ToolRunner {
6
- #worker = new Worker ( 'app.worker.js' , { type : 'module' } ) ;
8
+ #worker = new Worker ( workerURL , { type : 'module' } ) ;
7
9
#packages: null | string [ ] = null ;
8
10
9
11
private initializeWorker ( packages : string [ ] ) : Worker {
10
12
if ( JSON . stringify ( this . #packages) !== JSON . stringify ( packages ) ) {
11
13
if ( this . #worker !== null && this . #packages !== null ) {
12
14
// Terminate and re-initialize if the set of packages has changed.
13
15
this . #worker. terminate ( ) ;
14
- this . #worker = new Worker ( 'app.worker.js' , { type : 'module' } ) ;
16
+ this . #worker = new Worker ( workerURL , { type : 'module' } ) ;
15
17
}
16
18
this . #worker. postMessage ( { type : 'loadPackages' , pkgs : packages } ) ;
17
19
this . #packages = packages ;
You can’t perform that action at this time.
0 commit comments