Update ScheduledTaskExtensions.cs

This commit is contained in:
Mira 2023-06-18 20:47:23 +02:00
parent 2b2a53466f
commit 647d7c4a1c
Signed by untrusted user who does not match committer: Xorog
GPG key ID: 983798ED9C3E7C36

View file

@ -11,7 +11,7 @@ public static class ScheduledTaskExtensions
public static string CreateScheduledTask(this Task task, DateTime runTime, object? customData = null) public static string CreateScheduledTask(this Task task, DateTime runTime, object? customData = null)
{ {
if (task.Status != TaskStatus.WaitingForActivation) if (task.Status != TaskStatus.Created)
throw new InvalidOperationException("The task is already being executed or has been scheduled for execution.") throw new InvalidOperationException("The task is already being executed or has been scheduled for execution.")
.AttachData("Task", task) .AttachData("Task", task)
.AttachData("RunTime", runTime) .AttachData("RunTime", runTime)