Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Correctly update last fetch time
Browse files Browse the repository at this point in the history
If the next event is replaced, use the new timestamp
  • Loading branch information
p1gp1g committed Nov 1, 2023
1 parent f9975cc commit 51bcd91
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,9 @@ object FcmFetchManager {
if (highPriority) {
this.highPriority = true
}
val now = System.nanoTime()
val performedReplace = EXECUTOR.enqueue { fetch(context, now) }
if (performedReplace) {
Log.i(TAG, "Already have one running and one enqueued. Ignoring.")
} else {
last = now
Log.i(TAG, "Updating last event to $last")
}
last = System.nanoTime()
Log.i(TAG, "Updating last event to $last")
EXECUTOR.enqueue { fetch(context, last) }
}
}

Expand Down

0 comments on commit 51bcd91

Please sign in to comment.