sqlx: fixed CacheIndexService initial logic

r/paopao-ce-xtra
Michael Li 2 years ago
parent 1226a1a60d
commit 85b0c4ac56
No known key found for this signature in database

@ -73,16 +73,23 @@ func NewDataService() (core.DataService, core.VersionInfo) {
}
// initialize core.CacheIndexService
if cfg.If("SimpleCacheIndex") {
cfg.On(cfg.Actions{
"SimpleCacheIndex": func() {
// simpleCache use special post index service
ips = newSimpleIndexPostsService(_db, ths)
cis, v = cache.NewSimpleCacheIndexService(ips)
} else if cfg.If("BigCacheIndex") {
},
"BigCacheIndex": func() {
// TODO: make cache index post in different scence like friendship/followship/lightship
cis, v = cache.NewBigCacheIndexService(ips, ams)
} else {
},
"RedisCacheIndex": func() {
cis, v = cache.NewRedisCacheIndexService(ips, ams)
},
}, func() {
// defualt no cache
cis, v = cache.NewNoneCacheIndexService(ips)
}
})
logrus.Infof("use %s as cache index service by version: %s", v.Name(), v.Version())
ds := &dataSrv{

Loading…
Cancel
Save