mirror of
https://github.com/go-task/task.git
synced 2025-08-10 22:42:19 +02:00
fix: increase max task calls limit from 100 to 1000
Closes #1321 Closes #1332
This commit is contained in:
@@ -8,6 +8,10 @@
|
|||||||
#1342 by @pd93).
|
#1342 by @pd93).
|
||||||
- Added a new [exit code](https://taskfile.dev/api/#exit-codes) (107) for when a
|
- Added a new [exit code](https://taskfile.dev/api/#exit-codes) (107) for when a
|
||||||
Taskfile does not contain a schema version (#1342 by @pd93).
|
Taskfile does not contain a schema version (#1342 by @pd93).
|
||||||
|
- Increased limit of maximum task calls from 100 to 1000 for now, as some people
|
||||||
|
have been reaching this limit organically now that we have loops. This check
|
||||||
|
exists to detect recursive calls, but will be removed in favor of a better
|
||||||
|
algorithm soon (#1321, #1332).
|
||||||
|
|
||||||
## v3.30.1 - 2023-09-14
|
## v3.30.1 - 2023-09-14
|
||||||
|
|
||||||
|
7
task.go
7
task.go
@@ -34,7 +34,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
// MaximumTaskCall is the max number of times a task can be called.
|
// MaximumTaskCall is the max number of times a task can be called.
|
||||||
// This exists to prevent infinite loops on cyclic dependencies
|
// This exists to prevent infinite loops on cyclic dependencies
|
||||||
MaximumTaskCall = 100
|
MaximumTaskCall = 1000
|
||||||
)
|
)
|
||||||
|
|
||||||
func shouldPromptContinue(input string) bool {
|
func shouldPromptContinue(input string) bool {
|
||||||
@@ -173,7 +173,10 @@ func (e *Executor) RunTask(ctx context.Context, call taskfile.Call) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !e.Watch && atomic.AddInt32(e.taskCallCount[t.Task], 1) >= MaximumTaskCall {
|
if !e.Watch && atomic.AddInt32(e.taskCallCount[t.Task], 1) >= MaximumTaskCall {
|
||||||
return &errors.TaskCalledTooManyTimesError{TaskName: t.Task}
|
return &errors.TaskCalledTooManyTimesError{
|
||||||
|
TaskName: t.Task,
|
||||||
|
MaximumTaskCall: MaximumTaskCall,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
release := e.acquireConcurrencyLimit()
|
release := e.acquireConcurrencyLimit()
|
||||||
|
Reference in New Issue
Block a user