Files
panel/internal/command/cron.go
T
耗子 ea22c2f0a7 refactor(di): restore compile-time Wire injection
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.
2026-07-27 02:54:44 +08:00

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)
},
},
},
}
}