Skip to content

Commit

Permalink
chore: Update NCronJob to latest preview
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Apr 15, 2024
1 parent 17e4ff6 commit c1ef6ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageReference Include="Blazored.Toast" Version="4.2.1" />
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" PrivateAssets="all" />
<PackageReference Include="LinkDotNet.NCronJob" Version="2.0.0-preview" />
<PackageReference Include="LinkDotNet.NCronJob" Version="2.0.2-preview" />
<PackageReference Include="Markdig" Version="0.37.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public static void AddBackgroundServices(this IServiceCollection services)
options.ServicesStopConcurrently = true;
});

services.AddNCronJob();
services.AddCronJob<BlogPostPublisher>(p => p.WithCronExpression("* * * * *"));
services.AddCronJob<TransformBlogPostRecordsJob>(p => p.WithCronExpression("0/10 * * * *"));
services.AddNCronJob(options =>
{
options.AddJob<BlogPostPublisher>(p => p.WithCronExpression("* * * * *"));
options.AddJob<TransformBlogPostRecordsJob>(p => p.WithCronExpression("0/10 * * * *"));
});
}
}

0 comments on commit c1ef6ce

Please sign in to comment.