Skip to content

Commit 5155a86

Browse files
committed
fixup: improve configuration
Signed-off-by: Simon Schrottner <[email protected]>
1 parent b6cd812 commit 5155a86

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

providers/flagd/pkg/configuration.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (cfg *ProviderConfiguration) updateFromEnvVar() {
233233
cfg.GracePeriod = time.Duration(seconds) * time.Second
234234
} else {
235235
// Handle parsing error
236-
cfg.log.Error(err, fmt.Sprintf("invalid grace period '%s': %v", gracePeriod, err))
236+
cfg.log.Error(err, fmt.Sprintf("invalid grace period '%s'", gracePeriod))
237237
}
238238
}
239239

@@ -409,3 +409,10 @@ func WithGrpcDialOptionsOverride(grpcDialOptionsOverride []grpc.DialOption) Prov
409409
p.GrpcDialOptionsOverride = grpcDialOptionsOverride
410410
}
411411
}
412+
413+
// WithGracePeriod allows to set a time window for the transition from stale to error state
414+
func WithGracePeriod(gracePeriod time.Duration) ProviderOption {
415+
return func(p *ProviderConfiguration) {
416+
p.GracePeriod = gracePeriod
417+
}
418+
}

0 commit comments

Comments
 (0)