diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/caddytls/tls.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/caddytls/tls.go b/modules/caddytls/tls.go index 778ae02..31c559c 100644 --- a/modules/caddytls/tls.go +++ b/modules/caddytls/tls.go @@ -458,20 +458,17 @@ func (t *TLS) cleanStorageUnits() { defer storageCleanMu.Unlock() // If storage was cleaned recently, don't do it again for now. Although the ticker - // drops missed ticks for us, config reloads discard the old ticker and replace it - // with a new one, possibly invoking a cleaning to happen again too soon. - // (We divide the interval by 2 because the actual cleaning takes non-zero time, - // and we don't want to skip cleanings if we don't have to; whereas if a cleaning - // took the entire interval, we'd probably want to skip the next one so we aren't + // calling this function drops missed ticks for us, config reloads discard the old + // ticker and replace it with a new one, possibly invoking a cleaning to happen again + // too soon. (We divide the interval by 2 because the actual cleaning takes non-zero + // time, and we don't want to skip cleanings if we don't have to; whereas if a cleaning + // took most of the interval, we'd probably want to skip the next one so we aren't // constantly cleaning. This allows cleanings to take up to half the interval's // duration before we decide to skip the next one.) if !storageClean.IsZero() && time.Since(storageClean) < t.storageCleanInterval()/2 { return } - // mark when storage cleaning was last initiated - storageClean = time.Now() - options := certmagic.CleanStorageOptions{ OCSPStaples: true, ExpiredCerts: true, @@ -504,6 +501,9 @@ func (t *TLS) cleanStorageUnits() { } } + // remember last time storage was finished cleaning + storageClean = time.Now() + t.logger.Info("finished cleaning storage units") } |