Skip to content

Commit

Permalink
Fixed merge error
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen committed Feb 11, 2024
1 parent 60f5067 commit 2512e59
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions src/requests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { sleep } from "../helper/index.js";
import { getCycle, cycleStatus } from "../helper/requests.js";
import processOpts from "../process/index.js";
import { GetUserData } from "../helper/users.js"
import { requestLogger as logger } from "../helper/logger.js"

const useProxy = process.env.WEBSHARE_TOKEN !== undefined;
const maxProxyIndex = process.env.WEBSHARE_PROXYAMOUNT;
Expand Down Expand Up @@ -68,26 +67,14 @@ export default class Requests {
const timeTaken = Date.now() - start;
const percentageOnTarget = (cycleLength * 500 * 60) / timeTaken;
const timePerRoom = (Date.now() - start) / cycleLength
await UploadStatus({ amountPerCycle: cycleLength, timePerRoom, percentageOnTarget })
if (opts.timestamp) timestamp = opts.timestamp;
}

if (timestamp) {
const usernames = Object.keys(users);
const stats = { users: {} };
for (let u = 0; u < usernames.length; u += 1) {
const username = usernames[u];
const user = users[username];
const userData = GetUserData(username)
stats.users[username] = handleCombinedRoomStats(user, userData);
}
await UploadStats(stats, timestamp)
const timeTaken = Date.now() - start;
const percentageOnTarget = (cycleLength * 500 * 60) / timeTaken;
const timePerRoom = (Date.now() - start) / cycleLength
await UploadStatus({ cycleDetails: { amount: cycleLength, success: status.processed.length, failed: status.failed.length, successRate: Math.round((status.processed.length / cycleLength) * 100) }, timePerRoom, percentageOnTarget, timeTaken })
}
await sleep(1000 * 1);
await UploadStatus({
cycleDetails:
{
amount: cycleLength, success: status.processed.length, failed: status.failed.length,
successRate: Math.round((status.processed.length / cycleLength) * 100)
},
timePerRoom, percentageOnTarget, timeTaken
})
}
else {
await sleep(1000 * 60);
Expand Down

0 comments on commit 2512e59

Please sign in to comment.