Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 2f979bd

Browse files
committed
Wire cache invalidations among pool members
1 parent 6426c2b commit 2f979bd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/models/workdir-context-pool.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ export default class WorkdirContextPool {
6767
forwardEvent('onDidUpdateRepository', 'did-update-repository');
6868
forwardEvent('onDidDestroyRepository', 'did-destroy-repository');
6969

70+
// Propagate global cache invalidations across all resident contexts
71+
disposable.add(context.getRepository().onDidGloballyInvalidate(spec => {
72+
this.withResidentContexts((_workdir, eachContext) => {
73+
if (eachContext !== context) {
74+
eachContext.getRepository().acceptInvalidation(spec);
75+
}
76+
});
77+
}));
78+
7079
if (!silenceEmitter) {
7180
this.emitter.emit('did-change-contexts', {added: new Set([directory])});
7281
}

0 commit comments

Comments
 (0)