Skip to content

Scheduled jobs for Generic Host and ASP.NET Core Web Host

License

Notifications You must be signed in to change notification settings

luca-esse/Hosting.ScheduledJobs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scheduled jobs for Generic Host and ASP.NET Core Web Host

public static async Task Main(string[] args)
{
    var host = new HostBuilder()
        .ConfigureServices((hostContext, services) =>
        {
            services.AddScheduledJob<MyJob>(options =>
            {
                // Crontab expression: At 04:05 on Sunday
                options.ExecutionSchedule = "5 4 * * sun";
            });
        })
        .Build();

    await host.RunAsync();
}

public class MyJob : IScheduledJob
{
    public Task ExecuteAsync()
    {
        // Do work.
        return Task.CompletedTask;
    }
}

About

Scheduled jobs for Generic Host and ASP.NET Core Web Host

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages