Skip to content
Discussion options

You must be logged in to vote

Yes, that's how the current code behaves. WithMaxConcurrency only limits handler executions, and the status flips before the slot is acquired.

In TickerQSchedulerBackgroundService, the loop calls SetTickersInProgress(...) for every due occurrence first. Only then does it queue each one behind the per-function SemaphoreSlim(maxConcurrency). So anything waiting on the semaphore is already InProgress in storage.

That ordering is also why SkipIfAlreadyRunning() never fires in your setup. It checks TickerCancellationTokenManager.IsParentRunningExcludingSelf(parentId, self), and an occurrence is only registered there after it has passed the semaphore and entered RunContextFunctionAsync. With ma…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AlexandruJurju
Comment options

Answer selected by AlexandruJurju
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants