aboutsummaryrefslogtreecommitdiff
path: root/internal/service/config.go
diff options
context:
space:
mode:
authorSlack Coder <slackcoder@server.ky>2025-05-16 14:37:12 -0500
committerSlack Coder <slackcoder@server.ky>2025-05-16 16:07:36 -0500
commitbde75151c4852029766ccafd091493f5686e4ab9 (patch)
tree850710e4526dacd76911eec50f1b98a0496ebf40 /internal/service/config.go
parentd75e17a48934e4896963fb0fee78dbd53f4e780b (diff)
downloadmirror-bde75151c4852029766ccafd091493f5686e4ab9.tar.xz
Enable immediate once only mirroring
Interpret Min/Max intervals of zero to mean the mirror should by pulled immediately and only once. Allow the user to be specific by adding per-mirror configuration for MinInterval and MaxInterval.
Diffstat (limited to 'internal/service/config.go')
-rw-r--r--internal/service/config.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/service/config.go b/internal/service/config.go
index 2a8da6e..d4faeb0 100644
--- a/internal/service/config.go
+++ b/internal/service/config.go
@@ -20,7 +20,12 @@ const (
// Global parameters
type GlobalConfig struct {
- MaxInterval *Duration `toml:"max-interval"`
+ // MaxInterval is the maximum time to wait before syncing with a
+ // mirror. The wait time is a randomly generated time between the Min
+ // and Max intervals. The mirror is immediately downloaded once if both
+ // the Min and Max intervals are set to zero.
+ MaxInterval *Duration `toml:"max-interval"`
+ // MinInterval is the minimum time to wait before syncing with a mirror.
MinInterval *Duration `toml:"min-interval"`
StagingMethod string `toml:"staging-method,omitempty"`
StagingPath string `toml:"staging-path,omitempty"`