Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Umbraco.Cms.Core.Configuration.Models;
[UmbracoOptions(Constants.Configuration.ConfigDistributedJobs)]
public class DistributedJobSettings
{
internal const string StaticPeriod = "00:00:10";
internal const string StaticPeriod = "00:00:05";
internal const string StaticDelay = "00:01:00";

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
/// </summary>
public class DistributedBackgroundJobModel
{
/// <summary>
/// The id of the job.
/// </summary>
public int Id { get; set; }

/// <summary>
/// Name of job.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
private DistributedJobDto MapToDto(DistributedBackgroundJobModel model) =>
new()
{
Id = model.Id,

Check warning on line 93 in src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DistributedJobRepository.cs

View check run for this annotation

CodeScene Delta Analysis / CodeScene Code Health Review (release/17.0)

❌ New issue: Code Duplication

The module contains 2 functions with similar structure: MapFromDto,MapToDto. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Name = model.Name,
Period = model.Period.Ticks,
LastRun = model.LastRun,
Expand All @@ -100,6 +101,7 @@
private DistributedBackgroundJobModel MapFromDto(DistributedJobDto jobDto) =>
new()
{
Id = jobDto.Id,
Name = jobDto.Name,
Period = TimeSpan.FromTicks(jobDto.Period),
LastRun = jobDto.LastRun,
Expand Down