Skip to content

Commit 979c609

Browse files
ohtakeseki yohei
authored andcommitted
fixup! Restore timestamp from database files
1 parent c887fda commit 979c609

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/server/LevelDBLib.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export default class LevelDBLib {
3939
}
4040
};
4141
const getDirectories = source => (isDirectory(source) ? readdirSync(source).map(name => join(source, name)).filter(isDirectory) : []);
42-
const dirs = getDirectories(path).map(p => LevelDBLib.unescapeNamespace(p.split(sep)[1]));
43-
return dirs.reduce((accumulator, d) => {
44-
const dbPath = join(path, d);
42+
const pages = getDirectories(path).map(p => LevelDBLib.unescapeNamespace(p.split(sep)[1]));
43+
return pages.reduce((accumulator, p) => {
44+
const dbPath = join(path, LevelDBLib.escapeNamespace(p));
4545
const directoryCreated = lstatSync(dbPath).mtime;
4646
const latestFileModified = new Date(Math.max(...readdirSync(dbPath).map(name => join(dbPath, name)).map(f => lstatSync(f).mtimeMs)));
4747
return Object.assign(accumulator, {
48-
[d]: {
48+
[p]: {
4949
created: directoryCreated,
5050
modified: latestFileModified,
5151
active: 0,

0 commit comments

Comments
 (0)