Skip to content

Commit

Permalink
add ratio limit
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Apr 25, 2024
1 parent 8004a07 commit 40f98a0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions svc/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ app.get('/retrieverData', async (req, res) => {
// Store in redis set
for (let i = 0; i < accountData.length; i++) {
const accountName = accountData[i].split('\t')[0];
const score = Number(await redis.hget('retrieverSteamIDs', accountName));
// Don't add high usage logons
if (score < 200) {
const reqs = Number(await redis.hget('retrieverSteamIDs', accountName));
const success = Number(await redis.hget('retrieverSuccessSteamIDs', accountName));
const ratio = success / reqs;
// Don't add high usage logons or high fail logons
if (reqs < 200 && (reqs < 50 || ratio > 0)) {
await redis.sadd('retrieverDataSet', accountData[i]);
}
}
Expand Down

0 comments on commit 40f98a0

Please sign in to comment.