all: Pass db intervals as args not env vars (#6448)

This commit is contained in:
Simon Frei
2020-03-24 13:53:20 +01:00
committed by GitHub
parent ca89f12be6
commit 7f23de4f03
4 changed files with 55 additions and 34 deletions
+6
View File
@@ -670,6 +670,12 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
secs, _ := strconv.Atoi(t)
appOpts.DeadlockTimeoutS = secs
}
if dur, err := time.ParseDuration(os.Getenv("STRECHECKDBEVERY")); err == nil {
appOpts.DBRecheckInterval = dur
}
if dur, err := time.ParseDuration(os.Getenv("STGCINDIRECTEVERY")); err == nil {
appOpts.DBIndirectGCInterval = dur
}
app := syncthing.New(cfg, ldb, evLogger, cert, appOpts)