Hi,
We need to execute 4 parallel jobs using the Fire and Forget job, but the processing seem in serial mode job by job (no parallel execution !)
Here my code
// init
var options = new SQLiteStorageOptions();
GlobalConfiguration.Configuration.UseSQLiteStorage("SQLiteHangfire", options);
var option = new BackgroundJobServerOptions
{
WorkerCount = Environment.ProcessorCount * 5,
ServerName = Environment.MachineName + "." + GetMac() // Nom unique !
};
app.UseHangfireServer(option);
app.UseHangfireDashboard();
// Adding the jobs
BackgroundJob.Enqueue(() => Job(1));
BackgroundJob.Enqueue(() => Job(10));
BackgroundJob.Enqueue(() => Job(100));
BackgroundJob.Enqueue(() => Job(1000));
// and my job Method is
public void Job(int id)
{
// Processing
Thread.Sleep(TimeSpan.FromMinutes(10));
}
Please help
Thanks