Skip to content

Conversation

@nikolajlauridsen
Copy link
Contributor

@nikolajlauridsen nikolajlauridsen commented Oct 24, 2025

The ID was missing when updating the distributed jobs status, meaning they would never actually update, and we kept running the same job over and over again.

If you now run and wait for the job to run (1 minute), you should see the database start updating.

I also reduced the period between job checks to 5 seconds, because the webhook jobs run every 10 seconds, so it seemed like a good idea to check more frequently than every 10 seconds

@nikolajlauridsen nikolajlauridsen marked this pull request as ready for review October 24, 2025 10:59
@Copilot Copilot AI review requested due to automatic review settings October 24, 2025 10:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds missing ID mapping to the distributed background job model to support proper updates during load-balanced backoffice operations. The primary issue was that the ID field was not being mapped between the DTO and domain model, which would prevent existing jobs from being properly updated in the database.

Key Changes:

  • Added nullable Id property to DistributedBackgroundJobModel to track job identity
  • Updated mapping methods to include ID field in both directions (model ↔ DTO)
  • Reduced distributed job execution period from 10 to 5 seconds

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/Umbraco.Infrastructure/Models/DistributedBackgroundJobModel.cs Added nullable Id property with XML documentation to track job identity
src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DistributedJobRepository.cs Updated MapToDto and MapFromDto methods to include ID field mapping
src/Umbraco.Core/Configuration/Models/DistributedJobSettings.cs Changed StaticPeriod constant from 10 to 5 seconds

@nikolajlauridsen nikolajlauridsen changed the base branch from v17/dev to release/17.0 October 24, 2025 11:02
Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and is working - I can see the umbracoDistributedJob.lastAttemptRun getting updated now.

Just raised a suggestion about nullability - but please use or keep as you have as you prefer.

@nikolajlauridsen nikolajlauridsen merged commit 981c9a7 into release/17.0 Oct 27, 2025
20 of 21 checks passed
@nikolajlauridsen nikolajlauridsen deleted the v17/hotfix/fix-background-jobs branch October 27, 2025 07:49
@nikolajlauridsen nikolajlauridsen added the release/no-notes Not directly part of the release (updating README, build scripts, tests, etc.) label Oct 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/no-notes Not directly part of the release (updating README, build scripts, tests, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants