mirror of
https://github.com/komodorio/helm-dashboard.git
synced 2026-03-24 11:48:04 +00:00
Auto-update repositories each 10 minutes, unless HD_NO_AUTOUPDATE is set
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -194,13 +195,12 @@ func (d *DataLayer) nsForCtx(ctx string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *DataLayer) PeriodicTasks(ctx context.Context) {
|
func (d *DataLayer) PeriodicTasks(ctx context.Context) {
|
||||||
if !d.StatusInfo.ClusterMode { // TODO: maybe have a separate flag for that?
|
// TODO: separate scanning setup for in-cluster?
|
||||||
log.Debugf("Not in cluster mode, not starting background tasks")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// auto-update repos
|
if os.Getenv("HD_NO_AUTOUPDATE") == "" {
|
||||||
go d.loopUpdateRepos(ctx, 10*time.Minute) // TODO: parameterize interval?
|
// auto-update repos
|
||||||
|
go d.loopUpdateRepos(ctx, 10*time.Minute) // TODO: parameterize interval?
|
||||||
|
}
|
||||||
|
|
||||||
// auto-scan
|
// auto-scan
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user