1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-02 16:35:19 +02:00

feat: auto cleanup of offline runners (#7803)

Fixes #7646

Adds a cron job to cleanup action runners that have been offline or inactive for X amount of time.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7803
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Julian Schlarb <julian.schlarb@denktmit.de>
Co-committed-by: Julian Schlarb <julian.schlarb@denktmit.de>
This commit is contained in:
Julian Schlarb 2025-06-08 00:13:37 +02:00 committed by Gusted
parent 4d44ae39e1
commit 4b6ccbd631
8 changed files with 274 additions and 2 deletions

View file

@ -46,6 +46,13 @@ type CleanupHookTaskConfig struct {
NumberToKeep int
}
// CleanupOfflineRunnersConfig represents a cron task with settings to clean up offline-runner
type CleanupOfflineRunnersConfig struct {
BaseConfig
OlderThan time.Duration
GlobalScopeOnly bool
}
// GetSchedule returns the schedule for the base config
func (b *BaseConfig) GetSchedule() string {
return b.Schedule