From 0bc2ec579d8fdf4afaccb601b01e4b76f3f1ffdf Mon Sep 17 00:00:00 2001 From: biglyderv Date: Sat, 1 Feb 2025 15:28:49 -0500 Subject: [PATCH] save progress --- .gitignore | 1 + site.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 92596cd..ae877bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ users.json users*.json +net*.json test.txt test*.txt /node_modules \ No newline at end of file diff --git a/site.js b/site.js index 8fec135..698ec1a 100644 --- a/site.js +++ b/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)`);