Skip to content

Replace IPluginBackgroundTask's fixed interval with a schedule TickerQ can own #138

Description

@PianoNic

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions