KDG-Net-Cron 0.0.2

dotnet add package KDG-Net-Cron --version 0.0.2                
NuGet\Install-Package KDG-Net-Cron -Version 0.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KDG-Net-Cron" Version="0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KDG-Net-Cron --version 0.0.2                
#r "nuget: KDG-Net-Cron, 0.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KDG-Net-Cron as a Cake Addin
#addin nuget:?package=KDG-Net-Cron&version=0.0.2

// Install KDG-Net-Cron as a Cake Tool
#tool nuget:?package=KDG-Net-Cron&version=0.0.2                

Getting started

Important: Ensure your application is always running, otherwise your jobs wont execute as expected.

  1. Configure the CRON service prior to building the application
var pgCronService = new KDG.Cron.CronService.PostgreSql();

pgCronService.ConfigureServices(serviceCollection, "postgres-connection-string");
```csharp
2. initialize the cron server and dashboard after building the application

```csharp
KDG.Cron.CronService.InitializeCronServer(webApp, "/optional-cron-job-url", optionalConfiguration);
  1. Initialize the cron scheduler and start scheduling jobs

var cronScheduler = new KDG.Cron.CronScheduler();

// initialize an ICronJob class
public class HelloWorldJob : KDG.Cron.ICronJob {
  public async Task Execute(){
    Console.WriteLine("Hello World!");
    await Task.CompletedTask;
  }
}

// register the new HelloWorldJob class to the service provider
services.AddSingleton<HelloWorldJob>();

// register the recurring job
cronScheduler.ScheduleRecurringJob(
  "unique-job-identifier",
  app.Services.GetRequiredService<HelloWorldJob>(),
  Hangfire.Cron.Minutely
);

Support

For support, please open an issue on our GitHub Issues page and provide your questions or feedback. We strive to address all inquiries promptly.

Contributing

To contribute to this project, please follow these steps:

  1. Fork the repository to your own GitHub account.
  2. Make your changes and commit them to your fork.
  3. Submit a pull request to the original repository with a clear description of what your changes do and why they should be included.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.2 66 9/20/2024
0.0.1 89 8/7/2024