Skip to content

Commit

Permalink
fix logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fajrifernanda committed Dec 4, 2024
1 parent 3a771f1 commit 8213e98
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ type Config struct {
// Make sure to not put a big number as the batch size to prevent a long-running script.
JanitorBatchSize int

// If unset the DefaultMaxArchiveSize is used. If set to a zero or a negative value, nothing will be archived.
// If unset or below 1, the DefaultMaxArchiveSize is used.
MaxArchiveSize *int

// ArchivedExpirationInDays specifies the number of days after which archived tasks are deleted.
Expand Down Expand Up @@ -440,6 +440,10 @@ func validateConfig(cfg *Config) {
value := base.DefaultMaxArchiveSize
cfg.MaxArchiveSize = &value
}
if *(cfg.MaxArchiveSize) < 0 {
value := base.DefaultMaxArchiveSize
cfg.MaxArchiveSize = &value
}

Check warning on line 446 in server.go

View check run for this annotation

Codecov / codecov/patch

server.go#L444-L446

Added lines #L444 - L446 were not covered by tests
if cfg.ArchivedExpirationInDays == nil {
value := base.DefaultArchivedExpirationInDays
cfg.ArchivedExpirationInDays = &value
Expand Down

0 comments on commit 8213e98

Please sign in to comment.