fix: retire cron containers past their active deadline

Cron containers were never reaped once they exceeded their active deadline, so a hung cron task ran indefinitely instead of being retired after 24 hours as documented. `cron:run` now also accepts a `--ttl-seconds` argument, matching the one `dokku run` already takes.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-08-12 13:11:34 -04:00
1 parent 0bfd35dada
commit 96d726c43c
18 files changed
+1170 -906

No files matched your search

+2 -1
View File
@@ -49,10 +49,11 @@ func main() {
case "run":
args := flag.NewFlagSet("cron:run", flag.ExitOnError)
detached := args.Bool("detach", false, "--detach: run the container in a detached mode")
ttlSeconds := args.Int64("ttl-seconds", cron.DefaultTTLSeconds, "--ttl-seconds: number of seconds the task may run before it is reaped")
args.Parse(os.Args[2:])
appName := args.Arg(0)
cronID := args.Arg(1)
err = cron.CommandRun(appName, cronID, *detached)
err = cron.CommandRun(appName, cronID, *detached, *ttlSeconds)
case "set":
args := flag.NewFlagSet("cron:set", flag.ExitOnError)
global := args.Bool("global", false, "--global: set a global property")