vegapokerbot/internal/handler/store/init.go

31 lines
543 B
Go
Raw Normal View History

2024-05-09 23:26:21 +03:00
package store
import (
"github.com/maypok86/otter"
"time"
)
func init() {
cache, err := otter.MustBuilder[int64, PollState](10_000).
Cost(func(key int64, value PollState) uint32 {
return 1
}).
WithTTL(time.Hour * 24 * 7).
Build()
if err != nil {
panic(err)
}
Polls = cache
redmineSetups, err := otter.MustBuilder[int64, *RedmineSetup](1000).
Cost(func(key int64, value *RedmineSetup) uint32 {
return 1
}).
WithTTL(time.Hour * 24 * 7).
Build()
if err != nil {
panic(err)
}
RedmineSetups = redmineSetups
}