Skip to content

Commit c89baea

Browse files
committed
exit early if maxTasks <= 0
1 parent fd7ff68 commit c89baea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dbos/system_database.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,6 +2079,10 @@ func (s *sysDB) dequeueWorkflows(ctx context.Context, input dequeueWorkflowsInpu
20792079
}
20802080
}
20812081

2082+
if maxTasks <= 0 {
2083+
return nil, nil
2084+
}
2085+
20822086
// Build the query to select workflows for dequeueing
20832087
// Use SKIP LOCKED when no global concurrency is set to avoid blocking,
20842088
// otherwise use NOWAIT to ensure consistent view across processes

0 commit comments

Comments
 (0)