Skip to content

Commit c87aa86

Browse files
committed
do not allow to bypass ephemeral check
1 parent e21e91d commit c87aa86

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

services/actions/task.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ func PickTask(ctx context.Context, runner *actions_model.ActionRunner) (*runnerv
2424
if runner.Ephemeral {
2525
var task actions_model.ActionTask
2626
has, err := db.GetEngine(ctx).Where("runner_id = ?", runner.ID).Get(&task)
27-
if err == nil && has {
27+
// Let the runner retry the request, do not allow to proceed
28+
if err != nil {
29+
return nil, false, err
30+
}
31+
if has {
2832
if task.Status == actions_model.StatusWaiting || task.Status == actions_model.StatusRunning || task.Status == actions_model.StatusBlocked {
2933
return nil, false, nil
3034
}

0 commit comments

Comments
 (0)