save progress
This commit is contained in:
parent
fdffb5e4b8
commit
0bc2ec579d
2 changed files with 12 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
users.json
|
||||
users*.json
|
||||
net*.json
|
||||
test.txt
|
||||
test*.txt
|
||||
/node_modules
|
12
site.js
12
site.js
|
@ -259,6 +259,13 @@ async function siteCollector(user, path, site, useLimit, data2) {
|
|||
|
||||
let users = [];
|
||||
let data = {};
|
||||
try {
|
||||
let fil = await readFile(`./net_${btoa(penv[0])}.json`);
|
||||
data = JSON.parse(fil);
|
||||
console.log(`Archive found.`)
|
||||
} catch (err) {
|
||||
data = {};
|
||||
}
|
||||
|
||||
users = await rounder(penv, data, false);
|
||||
|
||||
|
@ -324,9 +331,12 @@ async function siteCollector(user, path, site, useLimit, data2) {
|
|||
}
|
||||
|
||||
let srz = JSON.stringify(dat2);
|
||||
let ff = `./users_${i}.json`;
|
||||
let ff = `./users_${i}_${btoa(penv[0])}.json`;
|
||||
await writeFile(ff, srz, 'utf8');
|
||||
console.log(`Temporary file ${ff} is written`);
|
||||
ff = `./net_${btoa(penv[0])}.json`;
|
||||
await writeFile(ff, JSON.stringify(data), 'utf8');
|
||||
console.log(`Temporary file ${ff} is written`);
|
||||
}
|
||||
|
||||
console.log(`Graph is complete (${Object.keys(users).length} entries)`);
|
||||
|
|
Loading…
Reference in a new issue