Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
Adjusted wait period and added logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mircoxi committed Feb 26, 2023
1 parent 931fcbb commit cb7fdb8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Scraps/Services/RaffleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,16 @@ private async Task JoinRafflesAsync()
_log.Error("Unable to join raffle {Id}: {Message}", raffle, joinRaffleResponse?.Message ?? "Unknown");
}

Broadcast("Waiting to join next raffle");

System.Random _randomifier = new System.Random();
int _joinModifier = _randomifier.Next(0, 6000);
int _joinModifier = _randomifier.Next(0, 10000);

int _joinDelayJittered = _joinDelay + _joinModifier;

_log.Info("Waiting for next raffle, attempting to join in {Delay} seconds", _joinDelayJittered / 1000);

Broadcast("Waiting to join next raffle");


await Task.Delay(_joinDelayJittered, _cancelToken);
}
else
Expand Down

0 comments on commit cb7fdb8

Please sign in to comment.