Skip to content

Scheduled Job has Started Sooner than Defined Time #2540

@ZenMaxe

Description

@ZenMaxe

I’ve observed that a job scheduled with BackgroundJob.Schedule has started before its defined UTC execution time.

In my case:

Scheduled time: 2025-08-13T09:51:48.509664Z

Actual execution start (from logs): 2025-08-13T09:51:48.375Z

Difference: ~134 milliseconds early

the compare code:
if (project.ExpirationDate >= DateTime.UtcNow)

schedule code:

   _backgroundJobClient.Schedule<IProjectExpirationService>(x => x.CheckAndExpireProjectAsync(
            notification.DomainEvent.ProjectId, CancellationToken.None), notification.DomainEvent.ExpirationDate);

ExpirationDate is UTC DateTime

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions