Skip to content

Commit

Permalink
Auto-update repositories each 10 minutes, unless HD_NO_AUTOUPDATE is set
Browse files Browse the repository at this point in the history
  • Loading branch information
undera committed Mar 6, 2023
1 parent bbb425b commit d95cac9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/dashboard/objects/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"os"
"sync"
"time"

Expand Down Expand Up @@ -194,13 +195,12 @@ func (d *DataLayer) nsForCtx(ctx string) string {
}

func (d *DataLayer) PeriodicTasks(ctx context.Context) {
if !d.StatusInfo.ClusterMode { // TODO: maybe have a separate flag for that?
log.Debugf("Not in cluster mode, not starting background tasks")
return
}
// TODO: separate scanning setup for in-cluster?

// auto-update repos
go d.loopUpdateRepos(ctx, 10*time.Minute) // TODO: parameterize interval?
if os.Getenv("HD_NO_AUTOUPDATE") == "" {
// auto-update repos
go d.loopUpdateRepos(ctx, 10*time.Minute) // TODO: parameterize interval?
}

// auto-scan
}
Expand Down

0 comments on commit d95cac9

Please sign in to comment.