Skip to content

Commit

Permalink
Extract magic number
Browse files Browse the repository at this point in the history
  • Loading branch information
mvshao committed Sep 18, 2024
1 parent 8bcc685 commit 7da7bbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hack/runtime-cleanup/cmd/cleaner/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"time"
)

const deleteAfter = 24 * time.Hour

type RuntimeCleaner struct {
k8sClient client.Client
log *slog.Logger
Expand Down Expand Up @@ -45,7 +47,7 @@ func (r RuntimeCleaner) removeOldRuntimes() error {
}

func isTimeForCleanup(runtimeObj imv1.Runtime) bool {
return runtimeObj.CreationTimestamp.Add(24 * time.Hour).Before(time.Now())
return runtimeObj.CreationTimestamp.Add(deleteAfter).Before(time.Now())
}

func isControlledByKIM(runtimeObj imv1.Runtime) bool {
Expand Down

0 comments on commit 7da7bbf

Please sign in to comment.