3
3
4
4
import { cloneDeep } from 'lodash' ;
5
5
import { IFileSystem } from '../../common/platform/types' ;
6
- import { IPersistentState } from '../../common/types' ;
7
- import { getGlobalPersistentStore } from '../common/externalDependencies' ;
6
+ import { getGlobalPersistentStore , IPersistentStore } from '../common/externalDependencies' ;
8
7
import { areSameEnvironment , PartialPythonEnvironment } from '../info' ;
9
8
import { PythonEnvInfo } from './info' ;
10
9
@@ -58,7 +57,7 @@ export class PythonEnvInfoCache implements IEnvsCache {
58
57
59
58
private envsList : PythonEnvInfo [ ] | undefined ;
60
59
61
- private persistentStorage : IPersistentState < PythonEnvInfo [ ] > | undefined ;
60
+ private persistentStorage : IPersistentStore < PythonEnvInfo [ ] > | undefined ;
62
61
63
62
constructor ( private readonly isComplete : CompleteEnvInfoFunction ) { }
64
63
@@ -69,7 +68,7 @@ export class PythonEnvInfoCache implements IEnvsCache {
69
68
70
69
this . initialized = true ;
71
70
this . persistentStorage = getGlobalPersistentStore < PythonEnvInfo [ ] > ( 'PYTHON_ENV_INFO_CACHE' ) ;
72
- this . envsList = this . persistentStorage ?. value ;
71
+ this . envsList = this . persistentStorage ?. get ( ) ;
73
72
}
74
73
75
74
public getAllEnvs ( ) : PythonEnvInfo [ ] | undefined {
@@ -100,7 +99,7 @@ export class PythonEnvInfoCache implements IEnvsCache {
100
99
const completeEnvs = this . envsList ?. filter ( this . isComplete ) ;
101
100
102
101
if ( completeEnvs ?. length ) {
103
- await this . persistentStorage ?. updateValue ( completeEnvs ) ;
102
+ await this . persistentStorage ?. set ( completeEnvs ) ;
104
103
}
105
104
}
106
105
}
0 commit comments