From 60c52ee4cebc8cde7dbd2a4c89bde01aa1b4840b Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Thu, 12 Dec 2024 18:11:47 -0500 Subject: [PATCH] cmd/stepd: Be able to trim multiple things --- cmd/stepd/main.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/stepd/main.go b/cmd/stepd/main.go index 7a56bc0..ab69477 100644 --- a/cmd/stepd/main.go +++ b/cmd/stepd/main.go @@ -225,7 +225,9 @@ func main () { // set up the trimming routine trimmer := trimmerRoutine { - Trimmer: &handler, + Trimmers: []step.Trimmer { + &handler, + }, } // set up the routine manager @@ -266,7 +268,7 @@ func (this *httpServerRoutine) Run (ctx context.Context) error { } type trimmerRoutine struct { - Trimmer step.Trimmer + Trimmers []step.Trimmer } func (this *trimmerRoutine) Run (ctx context.Context) error { @@ -275,7 +277,9 @@ func (this *trimmerRoutine) Run (ctx context.Context) error { for { select { case <- ticker.C: - this.Trimmer.Trim() + for _, trimmer := range this.Trimmers { + trimmer.Trim() + } case <- ctx.Done(): return ctx.Err() }