浏览代码

fix duration

Thibault bui Koechlin 5 年之前
父节点
当前提交
d9f4e0f7e2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      pkg/sqlite/sqlite.go

+ 2 - 2
pkg/sqlite/sqlite.go

@@ -38,13 +38,12 @@ func NewSQLite(cfg map[string]string) (*Context, error) {
 			log.Errorf("Ignoring invalid max_records '%s' : %s", v, err)
 		}
 	}
-	if v, ok := cfg["max_records_duration"]; ok {
+	if v, ok := cfg["max_records_age"]; ok {
 		c.maxDurationRetention, err = time.ParseDuration(v)
 		if err != nil {
 			log.Errorf("Ignoring invalid duration '%s' : %s", v, err)
 		}
 	}
-	log.Warningf("NEW SQLITE : %+v", cfg)
 	if _, ok := cfg["db_path"]; !ok {
 		return nil, fmt.Errorf("please specify a 'db_path' to SQLite db in the configuration")
 	}
@@ -52,6 +51,7 @@ func NewSQLite(cfg map[string]string) (*Context, error) {
 	if cfg["db_path"] == "" {
 		return nil, fmt.Errorf("please specify a 'db_path' to SQLite db in the configuration")
 	}
+	log.Warningf("Starting SQLite backend, path:%s", cfg["db_path"])
 
 	c.Db, err = gorm.Open("sqlite3", cfg["db_path"]+"?_busy_timeout=1000")
 	if err != nil {