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

This commit is contained in:
Nariman Jelveh
2025-10-12 19:50:48 -07:00
committed by GitHub
parent 8bf13b1b82
commit 661f13fc92
+6 -2
View File
@@ -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) => {