File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
plugins/plugin-codeflare/src/tray/watchers/profile Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,15 @@ export default class ProfileWatcher {
3232 private readonly updateFn : UpdateFunction ,
3333 private readonly profilesPath : string ,
3434 private readonly watcher = chokidar . watch ( profilesPath , { depth : 1 } )
35- ) { }
35+ ) {
36+ // we need to close the chokidar watcher before exit, otherwise
37+ // electron-main dies with SIGABRT
38+ import ( "electron" ) . then ( ( _ ) =>
39+ _ . app . on ( "will-quit" , async ( ) => {
40+ await this . watcher . close ( )
41+ } )
42+ )
43+ }
3644
3745 /** Initialize `this._profiles` model */
3846 public async init ( ) : Promise < ProfileWatcher > {
Original file line number Diff line number Diff line change @@ -40,7 +40,15 @@ export default class ProfileRunWatcher {
4040 private readonly updateFn : UpdateFunction ,
4141 private readonly profile : string ,
4242 private readonly watcher = chokidar . watch ( ProfileRunWatcher . path ( profile ) + "/*" , { depth : 1 } )
43- ) { }
43+ ) {
44+ // we need to close the chokidar watcher before exit, otherwise
45+ // electron-main dies with SIGABRT
46+ import ( "electron" ) . then ( ( _ ) =>
47+ _ . app . on ( "will-quit" , async ( ) => {
48+ await this . watcher . close ( )
49+ } )
50+ )
51+ }
4452
4553 private static path ( profile : string ) {
4654 return Profiles . guidebookJobDataPath ( { profile } )
You can’t perform that action at this time.
0 commit comments