Skip to content

Commit

Permalink
fix bug in caching that caused tar to say fils were changed as we read
Browse files Browse the repository at this point in the history
- actual bug was that we forgot to cache the ctime (=mtime)
  • Loading branch information
williamstein committed Oct 21, 2023
1 parent c804d89 commit e0f2406
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions websocketfs/lib/sftp-fuse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@ export default class SftpFuse {
for (const { filename, stats, longname } of items) {
try {
stats.blocks = parseInt(longname.split(" ")[0]);
} catch (_) {}
this.attrCache.set(join(path, filename), { attr: stats });
} catch (err) {}
const attr = { ...stats, ctime: stats.mtime };
this.attrCache.set(join(path, filename), { attr });
}
}
this.dirCache?.set(path, filenames);
Expand Down
2 changes: 1 addition & 1 deletion websocketfs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "websocketfs",
"version": "0.10.1",
"version": "0.10.2",
"description": "Like sshfs, but over a WebSocket",
"main": "./dist/lib/index.js",
"scripts": {
Expand Down

0 comments on commit e0f2406

Please sign in to comment.