Skip to content

Commit

Permalink
userIdleFlipper: avoid infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 9, 2023
1 parent 928e201 commit 5892678
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bots/userIdleFlipper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ export class UserIdleFlipperBot implements Bot {
const success = await this.sendTxforChunk(usersChunk);
if (!success) {
const slice = usersChunk.length / 2;
if (slice < 1) {
return;
}
await sleepMs(SLEEP_MS);
await this.trySendTxforChunk(usersChunk.slice(0, slice));
await sleepMs(SLEEP_MS);
Expand Down

0 comments on commit 5892678

Please sign in to comment.