mirror of https://github.com/synctv-org/synctv
Opt: lazy init op
parent
1a1a5f810a
commit
b3221f108f
@ -0,0 +1,12 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/synctv-org/synctv/internal/op"
|
||||
)
|
||||
|
||||
func InitOp(ctx context.Context) error {
|
||||
op.Init(4096)
|
||||
return nil
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package op
|
||||
|
||||
import (
|
||||
"github.com/bluele/gcache"
|
||||
)
|
||||
|
||||
func Init(size int) error {
|
||||
userCache = gcache.New(size).
|
||||
LRU().
|
||||
Build()
|
||||
|
||||
movieCache = gcache.New(size).
|
||||
LRU().
|
||||
Build()
|
||||
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue