mirror of
https://github.com/tnb-labs/panel.git
synced 2026-09-01 14:55:12 +08:00
ea22c2f0a7
Replace the samber/do runtime container with explicit constructor dependencies and generated Wire graphs for ace and cli. Keep CLI application loading isolated and verify generated files in CI.
42 lines
898 B
Go
42 lines
898 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/leonelquinteros/gotext"
|
|
"github.com/urfave/cli/v3"
|
|
|
|
"github.com/acepanel/panel/v3/internal/service"
|
|
)
|
|
|
|
// CronCommand 计划任务命令组
|
|
func CronCommand(t *gotext.Locale, cliService *service.CliService) *cli.Command {
|
|
|
|
return &cli.Command{
|
|
Name: "cron",
|
|
Usage: t.Get("Cron task"),
|
|
Commands: []*cli.Command{
|
|
{
|
|
Name: "failed",
|
|
Usage: t.Get("Report a failed cron task, called by the task wrapper script"),
|
|
Flags: []cli.Flag{
|
|
&cli.UintFlag{
|
|
Name: "id",
|
|
Aliases: []string{"i"},
|
|
Usage: t.Get("Cron task ID"),
|
|
Required: true,
|
|
},
|
|
&cli.IntFlag{
|
|
Name: "code",
|
|
Aliases: []string{"c"},
|
|
Usage: t.Get("Exit code"),
|
|
},
|
|
},
|
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
|
return cliService.CronFailed(ctx, cmd)
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|