Skip to content

Commit b3626d8

Browse files
committed
refactor: only store ct-index file when recovery is enabled
1 parent d0ccdd7 commit b3626d8

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

internal/certificatetransparency/ct-watcher.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ func (w *Watcher) dropRemovedLogs(logList loglist3.LogList) {
258258
func (w *Watcher) Stop() {
259259
log.Printf("Stopping watcher\n")
260260

261-
// Store current CT Indexes before shutting down
262-
filePath := config.AppConfig.General.Recovery.CTIndexFile
263-
tempFilePath := fmt.Sprintf("%s.tmp", filePath)
264-
metrics.SaveCertIndexes(tempFilePath, filePath)
261+
if config.AppConfig.General.Recovery.Enabled {
262+
// Store current CT Indexes before shutting down
263+
filePath := config.AppConfig.General.Recovery.CTIndexFile
264+
metrics.SaveCertIndexes(filePath)
265+
}
265266

266267
w.cancelFunc()
267268
}

0 commit comments

Comments
 (0)