Skip to content

Commit

Permalink
chore: Update to NCronJob v1
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Apr 10, 2024
1 parent 381f12d commit 9e89942
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

private void RunVisitTransformer()
{
InstantJobRegistry.AddInstantJob<TransformBlogPostRecordsJob>();
InstantJobRegistry.RunInstantJob<TransformBlogPostRecordsJob>();
ToastService.ShowInfo("Transformer was started.");
}
}
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="0.13.2" />
<PackageReference Include="LinkDotNet.NCronJob" Version="1.0.0-preview" />
<PackageReference Include="Markdig" Version="0.36.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static void AddBackgroundServices(this IServiceCollection services)
options.ServicesStopConcurrently = true;
});

services.AddNCronJob(p => p.TimerInterval = TimeSpan.FromSeconds(30));
services.AddNCronJob();
services.AddCronJob<BlogPostPublisher>(p => p.CronExpression = "* * * * *");
services.AddCronJob<TransformBlogPostRecordsJob>(p => p.CronExpression = "0 * * * *");
services.AddCronJob<TransformBlogPostRecordsJob>(p => p.CronExpression = "* * * * *");
}
}

0 comments on commit 9e89942

Please sign in to comment.