Fix Timer ExecuteAt persistence (for Trigger)
Without ExecuteAt receiving a value (even if it lies in the past), the TimerTriggerProvider will keep triggering workflows containing a Timer.
This commit is contained in:
parent
28ac92b6ff
commit
8a4fae6f38
|
|
@ -32,11 +32,12 @@ namespace Elsa.Activities.Timers
|
|||
if (context.WorkflowExecutionContext.IsFirstPass)
|
||||
return Done();
|
||||
|
||||
if (Timeout <= Duration.Zero)
|
||||
var now = _clock.GetCurrentInstant();
|
||||
ExecuteAt = now.Plus(Timeout);
|
||||
|
||||
if (ExecuteAt <= now)
|
||||
return Done();
|
||||
|
||||
ExecuteAt = _clock.GetCurrentInstant().Plus(Timeout);
|
||||
|
||||
return Combine(Suspend(), new ScheduleWorkflowResult(ExecuteAt.Value));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue