Skip to content

Commit 2c7731f

Browse files
committed
disallow concurent runs of job #23
1 parent 7f05315 commit 2c7731f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/NTorSpectator.Observer/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949

5050
var jobDetail = JobBuilder.Create<SpectatorJob>()
5151
.WithDescription("Tor spectator job")
52+
.DisallowConcurrentExecution()
5253
.WithIdentity("tor-spectator")
5354
.Build();
54-
cfg.AddJob<SpectatorJob>(jobKey: jobDetail.Key, configure: j => {});
55+
cfg.AddJob<SpectatorJob>(jobKey: jobDetail.Key, configure: j => j.DisallowConcurrentExecution());
5556
cfg.AddTrigger(t => t.WithCronSchedule("0 0 * * * ?").ForJob(jobDetail));
5657
});
5758
builder.Services.AddQuartzServer(cfg => cfg.WaitForJobsToComplete = false);

0 commit comments

Comments
 (0)