Browse Source

fix(config): FORCE_REFRESH_INTERVAL duration should be in minutes

Regression introduced in commit c6536e8
Frédéric Guillot 7 months ago
parent
commit
e8f5c2446c
3 changed files with 4 additions and 4 deletions
  1. 1 1
      internal/config/config_test.go
  2. 2 2
      internal/config/options.go
  3. 1 1
      internal/config/parser.go

+ 1 - 1
internal/config/config_test.go

@@ -864,7 +864,7 @@ func TestForceRefreshInterval(t *testing.T) {
 		t.Fatalf(`Parsing failure: %v`, err)
 	}
 
-	expected := 42 * time.Second
+	expected := 42 * time.Minute
 	result := opts.ForceRefreshInterval()
 
 	if result != expected {

+ 2 - 2
internal/config/options.go

@@ -29,7 +29,7 @@ const (
 	defaultBasePath                           = ""
 	defaultWorkerPoolSize                     = 16
 	defaultPollingFrequency                   = 60 * time.Minute
-	defaultForceRefreshInterval               = 30 * time.Second
+	defaultForceRefreshInterval               = 30 * time.Minute
 	defaultBatchSize                          = 100
 	defaultPollingScheduler                   = "round_robin"
 	defaultSchedulerEntryFrequencyMinInterval = 5 * time.Minute
@@ -769,7 +769,7 @@ func (o *options) SortedOptions(redactSecret bool) []*option {
 		"OAUTH2_REDIRECT_URL":                    o.oauth2RedirectURL,
 		"OAUTH2_USER_CREATION":                   o.oauth2UserCreationAllowed,
 		"DISABLE_LOCAL_AUTH":                     o.disableLocalAuth,
-		"FORCE_REFRESH_INTERVAL":                 int(o.forceRefreshInterval.Seconds()),
+		"FORCE_REFRESH_INTERVAL":                 int(o.forceRefreshInterval.Minutes()),
 		"POLLING_FREQUENCY":                      int(o.pollingFrequency.Minutes()),
 		"POLLING_LIMIT_PER_HOST":                 o.pollingLimitPerHost,
 		"POLLING_PARSING_ERROR_LIMIT":            o.pollingParsingErrorLimit,

+ 1 - 1
internal/config/parser.go

@@ -139,7 +139,7 @@ func (p *parser) parseLines(lines []string) (err error) {
 		case "WORKER_POOL_SIZE":
 			p.opts.workerPoolSize = parseInt(value, defaultWorkerPoolSize)
 		case "FORCE_REFRESH_INTERVAL":
-			p.opts.forceRefreshInterval = parseInterval(value, time.Second, defaultForceRefreshInterval)
+			p.opts.forceRefreshInterval = parseInterval(value, time.Minute, defaultForceRefreshInterval)
 		case "BATCH_SIZE":
 			p.opts.batchSize = parseInt(value, defaultBatchSize)
 		case "POLLING_FREQUENCY":