@@ -39,6 +39,8 @@ import { traceError } from '../logging';
39
39
import { ActiveStateLocator } from './base/locators/lowLevel/activeStateLocator' ;
40
40
import { CustomWorkspaceLocator } from './base/locators/lowLevel/customWorkspaceLocator' ;
41
41
42
+ const PYTHON_ENV_INFO_CACHE_KEY = 'PYTHON_ENV_INFO_CACHEv2' ;
43
+
42
44
/**
43
45
* Set up the Python environments component (during extension activation).'
44
46
*/
@@ -68,7 +70,7 @@ export async function activate(api: IDiscoveryAPI, ext: ExtensionState): Promise
68
70
*/
69
71
const folders = vscode . workspace . workspaceFolders ;
70
72
// Trigger discovery if environment cache is empty.
71
- const wasTriggered = getGlobalStorage < PythonEnvInfo [ ] > ( ext . context , 'PYTHON_ENV_INFO_CACHE' , [ ] ) . get ( ) . length > 0 ;
73
+ const wasTriggered = getGlobalStorage < PythonEnvInfo [ ] > ( ext . context , PYTHON_ENV_INFO_CACHE_KEY , [ ] ) . get ( ) . length > 0 ;
72
74
if ( ! wasTriggered ) {
73
75
api . triggerRefresh ( ) . ignoreErrors ( ) ;
74
76
folders ?. forEach ( async ( folder ) => {
@@ -225,7 +227,7 @@ function putIntoStorage(storage: IPersistentStorage<PythonEnvInfo[]>, envs: Pyth
225
227
}
226
228
227
229
async function createCollectionCache ( ext : ExtensionState ) : Promise < IEnvsCollectionCache > {
228
- const storage = getGlobalStorage < PythonEnvInfo [ ] > ( ext . context , 'PYTHON_ENV_INFO_CACHE' , [ ] ) ;
230
+ const storage = getGlobalStorage < PythonEnvInfo [ ] > ( ext . context , PYTHON_ENV_INFO_CACHE_KEY , [ ] ) ;
229
231
const cache = await createCache ( {
230
232
get : ( ) => getFromStorage ( storage ) ,
231
233
store : async ( e ) => putIntoStorage ( storage , e ) ,
0 commit comments