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
-9
View File
@@ -13,7 +13,6 @@
package db
import (
"os"
"time"
"github.com/syncthing/syncthing/lib/db/backend"
@@ -62,14 +61,6 @@ type FileIntf interface {
// continue iteration, false to stop.
type Iterator func(f FileIntf) bool
var databaseRecheckInterval = 30 * 24 * time.Hour
func init() {
if dur, err := time.ParseDuration(os.Getenv("STRECHECKDBEVERY")); err == nil {
databaseRecheckInterval = dur
}
}
func NewFileSet(folder string, fs fs.Filesystem, db *Lowlevel) *FileSet {
return &FileSet{
folder: folder,