optimize code initial for bigcache

pull/362/head
Michael Li 2 years ago
parent 5659f06eb3
commit 325d271f91
No known key found for this signature in database

@ -14,9 +14,7 @@ var (
)
type bigCacheTweetsCache struct {
name string
version *semver.Version
bc *bigcache.BigCache
bc *bigcache.BigCache
}
func (s *bigCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) {

@ -5,6 +5,7 @@
package cache
import (
"context"
"time"
"github.com/allegro/bigcache/v3"
@ -28,7 +29,7 @@ func NewBigCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationM
c.MaxEntrySize = 10000
c.Logger = logrus.StandardLogger()
bc, err := bigcache.NewBigCache(c)
bc, err := bigcache.New(context.Background(), c)
if err != nil {
logrus.Fatalf("initial bigCahceIndex failure by err: %v", err)
}

Loading…
Cancel
Save