mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-03 20:21:40 +00:00
feat: update store cache
This commit is contained in:
@ -2,8 +2,8 @@ package store
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"sync"
|
||||
|
||||
"github.com/boojack/corgi/api"
|
||||
"github.com/boojack/corgi/server/profile"
|
||||
)
|
||||
|
||||
@ -11,16 +11,16 @@ import (
|
||||
type Store struct {
|
||||
db *sql.DB
|
||||
profile *profile.Profile
|
||||
cache api.CacheService
|
||||
|
||||
userCache sync.Map // map[int]*userRaw
|
||||
workspaceCache sync.Map // map[int]*memoRaw
|
||||
shortcutCache sync.Map // map[int]*shortcutRaw
|
||||
}
|
||||
|
||||
// New creates a new instance of Store.
|
||||
func New(db *sql.DB, profile *profile.Profile) *Store {
|
||||
cacheService := NewCacheService()
|
||||
|
||||
return &Store{
|
||||
db: db,
|
||||
profile: profile,
|
||||
cache: cacheService,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user