Skip to content

Commit 1eba02b

Browse files
committed
Env cache fixes: storage key + find() result check
1 parent 0af4e8d commit 1eba02b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/client/pythonEnvironments/base/envsCache.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class PythonEnvInfoCache implements IEnvsCache {
5555
constructor(private readonly isComplete: CompleteEnvInfoFunction) {}
5656

5757
public initialize(): void {
58-
this.persistentStorage = createGlobalPersistentStore<PythonEnvInfo[]>('mykey');
58+
this.persistentStorage = createGlobalPersistentStore<PythonEnvInfo[]>('PYTHON_ENV_INFO_CACHE');
5959
this.envsList = this.persistentStorage?.value;
6060
}
6161

@@ -84,7 +84,7 @@ export class PythonEnvInfoCache implements IEnvsCache {
8484
public async flush(): Promise<void> {
8585
const completeEnvs = this.envsList?.filter(this.isComplete);
8686

87-
if (completeEnvs) {
87+
if (completeEnvs?.length) {
8888
await this.persistentStorage?.updateValue(completeEnvs);
8989
}
9090
}

0 commit comments

Comments
 (0)