Skip to content

Commit

Permalink
added try catch block to schedule in SentryOkHttpEvent.scheduleFinish
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanosiano committed Sep 29, 2023
1 parent e711f8c commit bd028eb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public Debouncer(
}

/**
* @return true if the execution should be debounced due to the last execution being within within
* waitTimeMs, otherwise false.
* @return true if the execution should be debounced due to maxExecutions executions being made
* within waitTimeMs, otherwise false.
*/
public boolean checkForDebounce() {
final long now = timeProvider.getCurrentTimeMillis();
if ((lastExecutionTime.get() + waitTimeMs) <= now) {
if (lastExecutionTime.get() == 0 || (lastExecutionTime.get() + waitTimeMs) <= now) {
executions.set(0);
lastExecutionTime.set(now);
return false;
Expand Down

0 comments on commit bd028eb

Please sign in to comment.