refresh rate

This commit is contained in:
Nazar Kanaev
2020-10-13 22:16:24 +01:00
parent e17ce0fb31
commit 78844def40
3 changed files with 58 additions and 16 deletions

View File

@@ -31,6 +31,16 @@ func (s *Storage) GetSettingsValue(key string) interface{} {
return valDecoded
}
func (s *Storage) GetSettingsValueInt64(key string) int64 {
val := s.GetSettingsValue(key)
if val != nil {
if fval, ok := val.(float64); ok {
return int64(fval)
}
}
return 0
}
func (s *Storage) GetSettings() map[string]interface{} {
result := settingsDefaults()
rows, err := s.db.Query(`select key, val from settings;`)