Final part of run logs
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ accounts/
|
||||
Microsoft-Rewards-bot/
|
||||
node_modules/
|
||||
.env
|
||||
batch_logs.json
|
||||
5
index.js
5
index.js
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user