Final part of run logs

This commit is contained in:
2023-06-26 13:16:00 +02:00
parent f53657acaf
commit 7ddf460928
2 changed files with 7 additions and 1 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ accounts/
Microsoft-Rewards-bot/
node_modules/
.env
batch_logs.json

View File

@@ -305,6 +305,11 @@ async function main() {
logManager(`[${host}] Log file: batch_logs.json`, 'info');
for (const vpn of vpns) {
const currentDate = new Date();
const formattedDate = `${currentDate.getDate()}-${currentDate.getMonth() + 1}-${currentDate.getFullYear()}`;
const logEntries = JSON.parse(fs.readFileSync('batch_logs.json', 'utf8'));
const entry = logEntries.find(entries => entries.accountName === vpn);
if (entry && entry.accountName === formattedDate) continue;
logManager(`[${host}] Switching to VPN: [${vpn}]`, 'info');
const con = await vpnConnect(vpn);
if (con) continue;