From 57e43f1b1016c3e6d4316907cf7df45d69c5340c Mon Sep 17 00:00:00 2001 From: Steven Landers Date: Wed, 27 Mar 2024 11:19:02 -0400 Subject: [PATCH] increment waiting on sync --- tasks/scheduler.go | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tasks/scheduler.go b/tasks/scheduler.go index 8b816e0d7..e8f9a32ac 100644 --- a/tasks/scheduler.go +++ b/tasks/scheduler.go @@ -506,14 +506,21 @@ func (s *scheduler) executeTask(task *deliverTxTask) { task.Ctx = dCtx // in the synchronous case, we only want to re-execute tasks that need re-executing - // if already validated, then this does another validation - if s.synchronous && task.IsStatus(statusValidated) { - s.shouldRerun(task) + if s.synchronous { + // if already validated, then this does another validation if task.IsStatus(statusValidated) { - return + s.shouldRerun(task) + if task.IsStatus(statusValidated) { + return + } + } + + // waiting transactions may not yet have been reset + // this ensures a task has been reset and incremented + if !task.IsStatus(statusPending) { + task.Reset() + task.Increment() } - task.Reset() - task.Increment() } s.prepareTask(task)