File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,9 @@ func (s *TaskScheduler) runTask(ctx context.Context, task *Task) {
582582 Field ("task_name" , task .Name ).
583583 Msg ("failed to update next run time before execution" )
584584 }
585- } else {
585+ }
586+
587+ if ! task .AllowConcurrent {
586588 task .mutex .Lock ()
587589 task .IsRunning = true
588590 task .UpdatedAt = time .Now ()
@@ -644,7 +646,9 @@ func (s *TaskScheduler) runTask(ctx context.Context, task *Task) {
644646 nextRunTime = task .NextRun
645647 runCount = task .RunCount
646648 task .mutex .RUnlock ()
647- } else {
649+ }
650+
651+ if task .AllowConcurrent {
648652 nextRunTime = task .NextRun
649653 runCount = task .RunCount
650654 task .mutex .Unlock ()
@@ -708,7 +712,9 @@ func (s *TaskScheduler) runTask(ctx context.Context, task *Task) {
708712 task .mutex .RLock ()
709713 nextRunTime = task .NextRun
710714 task .mutex .RUnlock ()
711- } else {
715+ }
716+
717+ if task .AllowConcurrent {
712718 nextRunTime = task .NextRun
713719 task .mutex .Unlock ()
714720 }
You can’t perform that action at this time.
0 commit comments