SimpleRecurringJobs.Postgres 1.1.36

dotnet add package SimpleRecurringJobs.Postgres --version 1.1.36
                    
NuGet\Install-Package SimpleRecurringJobs.Postgres -Version 1.1.36
                    
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="SimpleRecurringJobs.Postgres" Version="1.1.36" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SimpleRecurringJobs.Postgres" Version="1.1.36" />
                    
Directory.Packages.props
<PackageReference Include="SimpleRecurringJobs.Postgres" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SimpleRecurringJobs.Postgres --version 1.1.36
                    
#r "nuget: SimpleRecurringJobs.Postgres, 1.1.36"
                    
#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.
#:package SimpleRecurringJobs.Postgres@1.1.36
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SimpleRecurringJobs.Postgres&version=1.1.36
                    
Install as a Cake Addin
#tool nuget:?package=SimpleRecurringJobs.Postgres&version=1.1.36
                    
Install as a Cake Tool

SimpleRecurringJobs

NuGet version (SimpleRecurringJobs)

SimpleRecurringJobs is a C# library designed for very easily running recurring jobs in your applications, where each job should run once per trigger regardless of how many instances of your application is running.

Dependencies

SimpleRecurringJobs is designed for work with .NET Core apps, and make use of the following Microsoft packages:

  • Microsoft.Extensions.DependencyInjection.Abstractions
  • Microsoft.Extensions.Hosting.Abstractions
  • Microsoft.Extensions.Logging.Abstractions

Additional packages are required depending on what extra functionality you need.

Samples

See SimpleJob for a simple job that executes with a given interval.

Jobs

IIntervalJob

Interval jobs run at certain intervals, disregarding the clock. Suitable for jobs that do not need to be run at specific times.

public class SimpleJob : IIntervalJob
{
    public string Id { get; } = "SimpleJob";
    public TimeSpan Interval { get; } = TimeSpan.FromSeconds(5);
    public TriggerCountMode Mode { get; } = TriggerCountMode.CountSinceLastTrigger;

    public async Task Execute(CancellationToken cancellationToken)
    {
        // todo: Do stuff!
    }
}

ICronJob

NuGet version (SimpleRecurringJobs.Cron)

Cron jobs run according to a cron expression. This requires the package SimpleRecurringJobs.Cron which has a dependency on the third-party package Cronos.

.AddCronScheduler() must be called in the builder callback in AddSimpleRecurringJobs(...). E.g.:

sc.AddSimpleRecurringJobs(
  b => b.UseInMemoryJobStore().AddCronScheduler().WithJob<SimpleCronJob>()
);
public class SimpleCronJob : ICronJob
{
    public string Id { get; } = "SimpleCronJob";

    public async Task Execute(CancellationToken cancellationToken)
    {
        _logger.LogInformation($"SimpleCronJob just executed. The clock is: {DateTime.UtcNow:T}");
    }

    public string Cron { get; } = "0/5 * * * * *"; // Every 5 sec
    
    public TriggerCountMode Mode { get; } = TriggerCountMode.CountSinceLastCompletion;
}

Stores

SimpleRecurringJobs requires a data store for storing job timestamps and job locks.

InMemory

The InMemory job store should only be used for local development. It will not work for multiple instances of your application.

services.AddSimpleRecurringJobs(b => b.UseInMemoryJobStore().WithJob<SimpleJob>());

Redis

NuGet version (SimpleRecurringJobs.Redis)

The package SimpleRecurringJobs.Redis allows using Redis for persisting job data. It depends on the Nuget package StackExchange.Redis.

var redisConnStr = ...; // Get Redis connection string from somewhere.
services.AddSimpleRecurringJobs(b => b.UseRedisJobStore(connStr, o => o.KeyPrefix = "MyJobs:").WithJob<SimpleJob>());

MongoDB

NuGet version (SimpleRecurringJobs.Mongo)

The package SimpleRecurringJobs.Mongo allows using MongoDB for persisting job data. It depends on the Nuget package MongoDB.Driver.

var mongoConnStr = ...; // Get MongoDB connection string from somewhere.
services.AddSimpleRecurringJobs(b => b.UseMongoJobStore(mongoConnStr, o => o.Database = "MyAppDb").WithJob<SimpleJob>());

Postgres

NuGet version (SimpleRecurringJobs.Postgres)

The package SimpleRecurringJobs.Postgres allows using PostgreSQL for persisting job data. It depends on the Nuget package Npgsql.

var postgresConnStr = ...; // Get postgres connection string from somewhere.
services.AddSimpleRecurringJobs(b => b.UsePostgresJobStore(postgresConnStr).WithJob<SimpleJob>());
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
1.1.36 22 8/26/2025
1.1.35 1,517 9/11/2023
1.1.34 184 8/21/2023
1.1.33 522 8/1/2023
1.0.32 234 7/31/2023
1.0.31 219 7/31/2023
1.0.30 213 7/31/2023