mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: Dispose the kubeconfig watcher when application quits
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
673144ae8f
commit
d0116b3b62
@ -98,11 +98,19 @@ export class KubeconfigSyncManager {
|
|||||||
|
|
||||||
@action
|
@action
|
||||||
protected stopOldSync(filePath: string): void {
|
protected stopOldSync(filePath: string): void {
|
||||||
if (!this.sources.delete(filePath)) {
|
const source = this.sources.get(filePath);
|
||||||
|
|
||||||
// already stopped
|
// already stopped
|
||||||
|
if (!source) {
|
||||||
return this.dependencies.logger.debug(`no syncing file/folder to stop`, { filePath });
|
return this.dependencies.logger.debug(`no syncing file/folder to stop`, { filePath });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [, disposer] = source;
|
||||||
|
|
||||||
|
disposer();
|
||||||
|
|
||||||
|
this.sources.delete(filePath);
|
||||||
|
|
||||||
this.dependencies.logger.info(`stopping sync of file/folder`, { filePath });
|
this.dependencies.logger.info(`stopping sync of file/folder`, { filePath });
|
||||||
this.dependencies.logger.debug(`${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) });
|
this.dependencies.logger.debug(`${this.sources.size} files/folders watched`, { files: Array.from(this.sources.keys()) });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user