mirror of
https://github.com/Swatinem/rust-cache
synced 2025-04-27 21:55:52 +00:00
serialization bugs
This commit is contained in:
parent
5bbbdb9115
commit
829dfd6b08
4 changed files with 23 additions and 12 deletions
13
dist/save/index.js
vendored
13
dist/save/index.js
vendored
|
@ -87340,8 +87340,11 @@ async function rmRF(dirName) {
|
|||
|
||||
|
||||
async function saveMtimes(targetDirs) {
|
||||
let times = new Map();
|
||||
let stack = new Array();
|
||||
let data = {
|
||||
roots: [],
|
||||
times: {},
|
||||
};
|
||||
let stack = [];
|
||||
// Collect all the incremental files
|
||||
for (const dir of targetDirs) {
|
||||
for (const maybeProfile of await external_fs_default().promises.readdir(dir)) {
|
||||
|
@ -87353,7 +87356,7 @@ async function saveMtimes(targetDirs) {
|
|||
}
|
||||
}
|
||||
// Save the stack as the roots - we cache these directly
|
||||
let roots = stack.slice();
|
||||
data.roots = stack.slice();
|
||||
while (stack.length > 0) {
|
||||
const dirName = stack.pop();
|
||||
const dir = await external_fs_default().promises.opendir(dirName);
|
||||
|
@ -87364,11 +87367,11 @@ async function saveMtimes(targetDirs) {
|
|||
else {
|
||||
const fileName = external_path_default().join(dirName, dirent.name);
|
||||
const { mtime } = await external_fs_default().promises.stat(fileName);
|
||||
times.set(fileName, mtime.getTime());
|
||||
data.times[fileName] = mtime.getTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
return { roots, times: times };
|
||||
return data;
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./src/save.ts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue