Hi, i have added multiple jobs in Enqueue method. Job should enqueue only once. But here Execute method is running multiple times.
If i have only one job in Enqueue method, then Execute method is running only once as i expected.
How to add multiple jobs in Enqueue method,but all the jobs should run only once?
or
Is there any other way to run multiple jobs in a single job? because All the jobs are not in a single solution. All are in different project. But i have to run all the jobs in sequence manner.
PFB the code
public static void Enqueue(string x, string y)
{
try
{
var jobId = BackgroundJob.Enqueue<Test1>(x => x.Execute(JobCancellationToken.Null, x, y));
Logger.Debug($"enqueued job: {jobId}");
jobId = BackgroundJob.Enqueue<Test2>(x => x.Execute(JobCancellationToken.Null, x, y));
Logger.Debug($"enqueued job: {jobId}");
jobId = BackgroundJob.Enqueue<Test3>(x => x.Execute(JobCancellationToken.Null, x, y));
Logger.Debug($"enqueued job: {jobId}");
}
catch (Exception ex)
{
}
}
[Queue(JobSettings.Queues.Core)]
[LogJobFailure]
[DisplayName("Test")]
[DisableConcurrentExecution(600)]
[AutomaticRetry(Attempts = 0)]
[ProlongExpirationTime(7)]
public void Execute(IJobCancellationToken token, string culture, string brand)
{
Enqueue(culture, brand);
}
Thank you.