All notable changes to NCronJob will be documented in this file. The project adheres to Semantic Versioning.
2.7.3 - 2024-06-01
- Don't depend on prerelease version in
net9.0
2.7.2 - 2024-06-01
- Ability to add a timezone for a "minimal job".
- Run jobs automatically when a job either succeeded or failed allowing to model a job pipeline. By @linkdotnet.
builder.Services.AddNCronJob(options =>
{
options.AddJob<ImportData>(p => p.WithCronExpression("0 0 * * *")
.ExecuteWhen(
success: s => s.RunJob<TransformData>("Optional Parameter"),
faulted: s => s.RunJob<Notify>("Another Optional Parameter"));
});
- Minimal API for instant jobs and job dependencies. By @linkdotnet.
public void MyOtherMethod() => jobRegistry.RunInstantJob((MyOtherService service) => service.Do());
- Replace
Microsoft.Extensions.Hosting
withMicrosoft.Extensions.Hosting.Abstractions
for better compatibility. Reported by @chrisls121 in #74. Implemented by @linkdotnet.
2.6.1 - 2024-05-25
This release has the same changes as 2.6.0
but fixes an issue in the release pipeline.
- The NuGet.org "Release Notes" section will from now on be empty. It will contain a link to the releases.
2.6.0 - 2024-05-25
- API signature improvements - Enhanced the job scheduling framework with new classes and interfaces to better support job lifecycle management, including startup configuration and notification handling. This includes the introduction of
StartupStage<TJob>
,NotificationStage<TJob>
,IJobStage
,IStartupStage<TJob>
, andINotificationStage<TJob>
. (#70) By @falvarez1
- Startup jobs - Run a job when the application starts. (#70) By @falvarez1
- Sample project - Added a sample project to demonstrate Startup Jobs. (#70) By @falvarez1
2.5.0 - 2024-05-21
- Instant jobs are executed with the highest priority.
- If an instant job is executed that is not registered, it will throw an exception instead of silently ignoring it.
2.4.6 - 2024-05-21
- Retry/Concurrency Attributes where ignored
2.4.5 - 2024-05-20
- Readded public constructor for
JobExeuctionContext
to make it unit testable
- Regex Indicator for cron expressions (IDE support)
2.4.4 - 2024-05-20
- New minimal API to register jobs. By @falvarez1 Jobs can be defined via a simple lambda:
builder.Services.AddNCronJob((ILoggerFactory factory, TimeProvider timeProvider) =>
{
var logger = factory.CreateLogger("My Job");
logger.LogInformation("Hello World - The current date and time is {Time}", timeProvider.GetLocalNow());
}, "*/5 * * * * *");
- Instant jobs did ignore the concurrency attribute and global concurrency settings. Fixed by @linkdotnet. Reported by @KorsG in #52
2.3.2 - 2024-05-08
- Scheduler took local time instead of UTC as base. By @falvarez1
2.3.1 - 2024-05-07
- TimeZone Support implemented by @falvarez1 in PR #22.
2.2.1 - 2024-05-05
- Ability to schedule a job to run after a specific delay.
- Ability to schedule a job to run at a specific time.
2.1.4 - 2024-05-01
- Retry Mechanism: Improved robustness of job executions, especially in cases of transient failures. Includes exponential backoff and fixed interval strategies.
- Concurrency Control: Introduced a
SupportsConcurrency
attribute to provide fine-grained control over the concurrency behavior of individual jobs. This attribute allows specifying the maximum degree of parallelism. - New WaitForJobsOrTimeout: Added an enhanced version of
WaitForJobsOrTimeout
to the Tests project that allows time advancement for each run, providing more precise control over test execution timing. - Cancellation Support: Jobs now support graceful cancellation during execution and SIGTERM.
- Concurrency Management: Implemented improved global concurrency handling techniques within
CronScheduler
. This change enhances flexibility and scalability in managing job executions. - Async Job Executions: Job executions are now fully async from the moment the scheduler triggers the job, ensuring better performance and resource utilization.
- Test Framework Bugs: Addressed specific bugs in the testing framework, ensuring that all tests are now passing and provide reliable results.
- CRON jobs that are scheduled more than 50 days in the future did throw an exception.
- Support for concurrent jobs and retries, as well as overall improvements, implemented by @falvarez1 in PR #21.
2.0.5 - 2024-04-19
- Implementation of the scheduling. Better performance and closed some memory leaks
- Throw exception if job cannot be resolved with dependencies from the DI container. Reported and implemented by @skarum in #23
2.0.4 - 2024-04-16
- Don't log running jobs twice. Reported by @ryanbuening. Fixed by @linkdotnet
2.0.3 - 2024-04-15
With v2
the overall API was cleaned up and made more consistent. AddNCronJob
and AddCronJob
are merged into one service defintion:
- The IDE can help with RegEx pattern thanks to the
StringSyntaxAttribute
. - Added more code documentation (xmldoc) with many examples to rely less on the README.
- In
v1
one would define as such:
services.AddNCronJob();
services.AddCronJob<PrintHelloWorld>(options =>
{
options.CronExpression = "* * * * *";
options.Parameter = "Hello World";
});
With v2
the CronExpression
is moved towards the builder pattern and AddCronJob
is merged into AddNCronJob
:
services.AddNCronJob(options =>
{
options.AddJob<PrintHelloWorld>(j =>
{
j.WithCronExpression("* * * * *")
.WithParameter("Hello World");
});
});
- Cleaned up
AddNCronJob
to not accidentally build the service container
1.0.2 - 2024-04-11
- Removed internal periodic timer so that instant jobs are really executed instantly and cron jobs on the correct time (rather than too late)
- The
IsolationLevel
was completely removed as jobs are executed in their own scope anyway. It behaves likeIsolation.NewTask
by default. TimerInterval
inNCronJobOptions
was removed as it no longer used.
0.13.2 - 2024-03-29
- Smaller performance improvements
0.13.1 - 2024-03-25
- Check if
IsolationLevel
is in a valid range - otherwise it throws an exception - Small refactorings
0.13.0 - 2024-03-23
- Moved
EnableSecondPrecision
fromAddNCronJob
toAddCronJob
to allow for more granular control over the precision of the cron expression - When a job is not registered, a error is logged, but the execution of other jobs is not interrupted
0.12.0 - 2024-03-22
- Breaking Change:
Run
is now calledRunAsync
to reflect the asynchronous nature of the method Run
doesn't take an optionalCancellationToken
anymore, as this is passed in anyway.
0.11.5 - 2024-03-22
0.11.4 - 2024-03-21
- Ability to set cron expressions with second-level precision
- Support for
net9.0
- Support for Isolation Level to run jobs independent of the current scheduler
- Notification system that allows to run a task when a job is finished
0.10.1 - 2024-03-19
- Every Job-Run has its own scope
0.10.0 - 2024-03-18
- Ability to set the timer interval
AddCronJob
registers as scoped service instead of transient
0.9.3 - 2024-03-18
AddCronJob
registers the job as transient instead of singleton
0.9.2 - 2024-03-17
- Simplified much of the logic for scheduling
- Instant jobs weren't executed correctly
0.9.1 - 2024-03-17
- Fixed some docs
0.9.0 - 2024-03-17
- Initial Release of NCronJob with lots of features
- The ability to schedule jobs using a cron expression
- The ability to instantly run a job
- Parameterized jobs - instant as well as cron jobs!
- Integrated in ASP.NET - Access your DI container like you would in any other service