fix: ensure the concurrency policy is propagated when running a cron command directly
This commit is contained in:
@@ -112,9 +112,11 @@ func CommandRun(appName string, cronID string, detached bool) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
command := ""
|
command := ""
|
||||||
|
concurrencyPolicy := "allow"
|
||||||
for _, task := range tasks {
|
for _, task := range tasks {
|
||||||
if task.ID == cronID {
|
if task.ID == cronID {
|
||||||
command = task.Command
|
command = task.Command
|
||||||
|
concurrencyPolicy = task.ConcurrencyPolicy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +136,7 @@ func CommandRun(appName string, cronID string, detached bool) error {
|
|||||||
os.Setenv("DOKKU_DISABLE_TTY", "true")
|
os.Setenv("DOKKU_DISABLE_TTY", "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
os.Setenv("DOKKU_CONCURRENCY_POLICY", concurrencyPolicy)
|
||||||
os.Setenv("DOKKU_CRON_ID", cronID)
|
os.Setenv("DOKKU_CRON_ID", cronID)
|
||||||
os.Setenv("DOKKU_RM_CONTAINER", "1")
|
os.Setenv("DOKKU_RM_CONTAINER", "1")
|
||||||
scheduler := common.GetAppScheduler(appName)
|
scheduler := common.GetAppScheduler(appName)
|
||||||
|
|||||||
Reference in New Issue
Block a user