File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/client/pythonEnvironments/base Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,20 @@ export interface IEnvsCache {
51
51
export type CompleteEnvInfoFunction = ( envInfo : PythonEnvInfo ) => boolean ;
52
52
53
53
export class PythonEnvInfoCache implements IEnvsCache {
54
+ private initialized = false ;
55
+
54
56
private envsList : PythonEnvInfo [ ] | undefined ;
55
57
56
58
private persistentStorage : IPersistentState < PythonEnvInfo [ ] > | undefined ;
57
59
58
60
constructor ( private readonly isComplete : CompleteEnvInfoFunction ) { }
59
61
60
62
public initialize ( ) : void {
63
+ if ( this . initialized ) {
64
+ return ;
65
+ }
66
+
67
+ this . initialized = true ;
61
68
this . persistentStorage = createGlobalPersistentStore < PythonEnvInfo [ ] > ( 'PYTHON_ENV_INFO_CACHE' ) ;
62
69
this . envsList = this . persistentStorage ?. value ;
63
70
}
You can’t perform that action at this time.
0 commit comments