mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 22:17:20 +00:00
Move registerActionsCleanup
to initActionsTasks
(#31721)
There's already `initActionsTasks`; it will avoid additional check for if Actions enabled to move `registerActionsCleanup` into it. And we don't really need `OlderThanConfig`.
This commit is contained in:
@ -19,6 +19,7 @@ func initActionsTasks() {
|
||||
registerStopEndlessTasks()
|
||||
registerCancelAbandonedJobs()
|
||||
registerScheduleTasks()
|
||||
registerActionsCleanup()
|
||||
}
|
||||
|
||||
func registerStopZombieTasks() {
|
||||
@ -63,3 +64,13 @@ func registerScheduleTasks() {
|
||||
return actions_service.StartScheduleTasks(ctx)
|
||||
})
|
||||
}
|
||||
|
||||
func registerActionsCleanup() {
|
||||
RegisterTaskFatal("cleanup_actions", &BaseConfig{
|
||||
Enabled: true,
|
||||
RunAtStart: true,
|
||||
Schedule: "@midnight",
|
||||
}, func(ctx context.Context, _ *user_model.User, _ Config) error {
|
||||
return actions_service.Cleanup(ctx)
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user