Schedule plugin tickers after TickerQ initialises - #282
Merged
Merged
Conversation
Ticker writes issued while plugins load were validated against a function registry TickerQ only builds when its own initializer hosted service starts, so every plugin task was dropped with a logged warning. Queue those writes and flush them from the scheduler's own StartAsync instead. Also translate the 5-field plugin cron into the 6-field, seconds-first form TickerQ parses, and back again for the status snapshot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[TickerFunction]registry from its own initializer hosted service at host start, but plugins load - and register their tickers - inUseSchulyPluginsAsync()before that, so every write failed validation withCannot find TickerFunction with name RunPluginTaskand was swallowed as a warning.TickerQPluginTaskSchedulernow implementsIHostedService: ticker writes that arrive before the host starts are queued in order and flushed from itsStartAsync, which runs after TickerQ's initializer because it is registered afterAddSchulyTickerQ.IncludingSeconds, so it needs 6 fields, whilePluginSchedulevalidates and produces standard 5-field cron. Plugin expressions are now normalised to the 6-field form on the way into TickerQ and reported back in their 5-field form, and the status snapshot parses with seconds so next-run and interval stay correct.FakePluginTaskScheduler, loads a plugin before host start, and asserts the cron ticker is actually persisted and reported. The old tests passed through a fake scheduler, which is why this shipped.Closes #281