mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 21:01:27 +00:00
improve caching mechanism by deleting specific caches on item addition in FileSystem module (#1745)
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
Docker Image CI / build-and-push-image (push) Has been cancelled
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
release-please / release-please (push) Has been cancelled
test / test (20.x) (push) Has been cancelled
test / test (22.x) (push) Has been cancelled
test / api-test (22.x) (push) Has been cancelled
This commit is contained in:
@@ -134,8 +134,12 @@ export class PuterJSFileSystemModule extends AdvancedBase {
|
||||
});
|
||||
|
||||
this.socket.on('item.added', (item) => {
|
||||
puter._cache.flushall();
|
||||
console.log('Flushed cache for item.added');
|
||||
// remove readdir cache for parent
|
||||
puter._cache.del('readdir:' + path.dirname(item.path));
|
||||
console.log('deleted cache for readdir:' + path.dirname(item.path));
|
||||
// remove item cache for parent directory
|
||||
puter._cache.del('item:' + path.dirname(item.path));
|
||||
console.log('deleted cache for item:' + path.dirname(item.path));
|
||||
});
|
||||
|
||||
this.socket.on('item.updated', (item) => {
|
||||
|
||||
Reference in New Issue
Block a user