The contract today is:
public interface IPluginBackgroundTask
{
string Name { get; }
TimeSpan Interval { get; }
Task ExecuteAsync(IServiceProvider serviceProvider, CancellationToken cancellationToken);
}
TimeSpan Interval is the limiting part. It cannot express "every morning at 06:00", and because the host waits the interval after a run finishes, the real period is interval plus duration, so a slow sync drifts further from its schedule every cycle. There is also nowhere to declare retry behaviour, so a failed run simply waits a full interval and tries again.
Moving the backend onto TickerQ (see schulydev/SchulyBackend) means the schedule wants to be something the scheduler can persist and reason about: a cron expression, plus optional retry count and retry intervals.
Changing or replacing a member of a published interface is a major bump under Versioning, so this needs deciding deliberately rather than in passing. Worth considering whether the plugin declares its schedule at all, or whether it only supplies the work and the operator owns the cadence.
Blocks schulydev/SchulyBackend and schulydev/SchulyPlugins.
The contract today is:
TimeSpan Intervalis the limiting part. It cannot express "every morning at 06:00", and because the host waits the interval after a run finishes, the real period is interval plus duration, so a slow sync drifts further from its schedule every cycle. There is also nowhere to declare retry behaviour, so a failed run simply waits a full interval and tries again.Moving the backend onto TickerQ (see schulydev/SchulyBackend) means the schedule wants to be something the scheduler can persist and reason about: a cron expression, plus optional retry count and retry intervals.
Changing or replacing a member of a published interface is a major bump under Versioning, so this needs deciding deliberately rather than in passing. Worth considering whether the plugin declares its schedule at all, or whether it only supplies the work and the operator owns the cadence.
Blocks schulydev/SchulyBackend and schulydev/SchulyPlugins.