Skip to content

Commit

Permalink
Use CachingLocator.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Sep 21, 2020
1 parent a9152c1 commit 390f221
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/client/pythonEnvironments/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { IServiceContainer, IServiceManager } from '../ioc/types';
import { PythonEnvInfo } from './base/info';
import { ILocator, IPythonEnvsIterator, PythonLocatorQuery } from './base/locator';
import { PythonEnvsChangedEvent } from './base/watcher';
import { CachingLocator } from './collection/cachingLocator';
import { ExtensionLocators, WorkspaceLocators } from './discovery/locators';
import { registerForIOC } from './legacyIOC';

Expand Down Expand Up @@ -49,11 +50,14 @@ export class PythonEnvironments implements ILocator {
*/
export function createAPI(): [PythonEnvironments, () => void] {
const [locators, activateLocators] = initLocators();
const cache = {}; // This will be filled in once we have it.
const cachingLocator = new CachingLocator(cache!, locators);

return [
new PythonEnvironments(locators),
new PythonEnvironments(cachingLocator),
() => {
activateLocators();
cachingLocator.initialize().ignoreErrors();
// Any other activation needed for the API will go here later.
}
];
Expand Down

0 comments on commit 390f221

Please sign in to comment.