Skip to content

Commit

Permalink
Make sure IdentifyRateLimiterImpl.consume does a tail-call
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Jan 30, 2024
1 parent e854d05 commit 3096b64
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private class IdentifyRateLimiterImpl(
// if the coroutine that called consume() is cancelled, the CancellableContinuation makes sure the waiting is
// stopped (the Gateway won't try to identify), so we don't need to hold the mutex and waste time for other
// calls
suspendCancellableCoroutine { continuation ->
return suspendCancellableCoroutine { continuation ->
val job = launchIdentifyWaiter(shardId, events, continuation)
continuation.invokeOnCancellation { job.cancel() }
}
Expand Down

0 comments on commit 3096b64

Please sign in to comment.