You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
synctv/internal/op/op.go

31 lines
473 B
Go

package op
import (
"github.com/bluele/gcache"
"github.com/synctv-org/synctv/internal/db"
"github.com/synctv-org/synctv/internal/model"
)
func Init(size int) error {
userCache = gcache.New(size).
LRU().
Build()
si, err := db.GetSettingItems()
if err != nil {
panic(err)
}
for _, si2 := range si {
switch si2.Type {
case model.SettingTypeBool:
b, ok := boolSettings[si2.Name]
if ok {
b.value = si2.Value
}
}
}
cleanReg()
return nil
}