Skip to content

TaskSchedulerService (Hangfire).

License

Notifications You must be signed in to change notification settings

rafaelfgx/TaskSchedulerService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TaskSchedulerService

Hangfire

Run

Command Line

Prerequisites

Steps

  1. Open directory source\TaskSchedulerService in command line and execute dotnet run.
  2. Open https://localhost:5000/hangfire.
Visual Studio Code

Prerequisites

Steps

  1. Open source directory in Visual Studio Code.
  2. Press F5.
Visual Studio

Prerequisites

Steps

  1. Open source\TaskSchedulerService.sln in Visual Studio.
  2. Set TaskSchedulerService as startup project.
  3. Press F5.

Jobs

Configure jobs in AppSettings.json.

"Jobs": [
    {
        "Id": "Job",
        "Name": "Job",
        "Url": "https://application.domain.com/job",
        "Method": "POST",
        "Cron": "* * * * *",
        "Active": "true"
    }
]

Cron

Cron Expression

Cron Generator

Examples

At every minute: * * * * *

At every hour: 0 * * * *

At every day: 0 0 * * *

At 00:00 on Sunday: 0 0 * * 0

At 00:00 on day-of-month 25: 0 0 25 * *

At 00:00 on every day-of-month from 25 through 31: 0 0 25-31 * *

At 08:30 on day-of-month 1 in June: 30 8 1 6 *

At 12:30 on Sunday and Saturday: 30 12 * * 0,6

At 18:20 on day-of-month 5 in every 6th month: 20 18 5 */6 *

At 20:00 on day-of-month 1: 0 20 1 * *

At 22:00 on every day-of-week from Monday through Friday: 0 22 * * 1-5

At every hour from 9 through 18: 0 9-18 * * *

At every hour from 12 through 14 on Saturday and Sunday: 0 12-14 * * 6,0

At every hour from 9 through 18 on every day-of-week from Monday through Friday: 0 9-18 * * 1-5

Best Practices

Idempotence

Reentrancy