Clear pack cache on create and delete
We were only clearing the pack cache when a pack file was modified. When using a script to create a new pack, the pack file is created at once without a change event firing. This will change the behavior to also clear the pack cache when a pack file is created or deleted.
This commit is contained in:
@@ -707,9 +707,14 @@ async function activateWithInstalledDistribution(
|
||||
for (const glob of PACK_GLOBS) {
|
||||
const fsWatcher = workspace.createFileSystemWatcher(glob);
|
||||
ctx.subscriptions.push(fsWatcher);
|
||||
fsWatcher.onDidChange(async (_uri) => {
|
||||
|
||||
const clearPackCache = async (_uri: Uri) => {
|
||||
await qs.clearPackCache();
|
||||
});
|
||||
};
|
||||
|
||||
fsWatcher.onDidCreate(clearPackCache);
|
||||
fsWatcher.onDidChange(clearPackCache);
|
||||
fsWatcher.onDidDelete(clearPackCache);
|
||||
}
|
||||
|
||||
void extLogger.log("Initializing database manager.");
|
||||
|
||||
Reference in New Issue
Block a user