Skip to content

Commit 2fb5107

Browse files
Merge pull request #209 from canopy-network/add-read-file-at-closure
fix: add write file before closure so nothing is delete
2 parents 1322844 + 63681f6 commit 2fb5107

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

auto-update/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,11 @@ func runAutoUpdate() {
342342
// block until kill signal is received
343343
s := <-stop
344344
log.Printf("Exit command %s received in auto update\n", s)
345+
config, err = lib.NewConfigFromFile(configFilePath)
346+
if err != nil {
347+
log.Printf("Failed to read config file on closure: %v", err)
348+
return
349+
}
345350
config.RunningAutoUpdate = false
346351
config.WriteToFile(configFilePath)
347352
// Gracefully terminate the current process

0 commit comments

Comments
 (0)