go-xorm / xorm-redis-cache Goto Github PK
View Code? Open in Web Editor NEWXORM Redis Cache
License: BSD 3-Clause "New" or "Revised" License
XORM Redis Cache
License: BSD 3-Clause "New" or "Revised" License
[xorm] [debug] 2017/12/05 18:05:30.548400 [redis_cacher] PutBean|tableName:created_insert|id:��PK����int64|key:xorm:bean:created_insert:��PK����int64|type:*tests.CreatedInsert
[xorm] [debug] 2017/12/05 18:05:30.548903 [redis_cacher] registerGobConcreteType:*tests.CreatedInsert
--- FAIL: TestMysqlWithCache (0.83s)
panic: gob: registering duplicate names for tests.CreatedInsert: "*tests.CreatedInsert" != "github.com/go-xorm/tests.CreatedInsert" [recovered]
panic: gob: registering duplicate names for tests.CreatedInsert: "*tests.CreatedInsert" != "github.com/go-xorm/tests.CreatedInsert"
func (c *RedisCacher) delObjects(key string) error {
c.logDebugf("delObjects key:[%s]", key)
conn := c.pool.Get()
defer conn.Close()
keys, err := conn.Do("KEYS", key)
c.logDebugf("delObjects keys: %v", keys)
if err == nil {
for _, key := range keys.([]interface{}) {
conn.Do("DEL", key)
}
}
return err
}
删除的时候用到了keys命令,db里面的key比较多的时候会导致卡顿,可以改成scan嘛?
此外,这个redis缓存好久不更新了,有生成使用的例子嘛?
When serialize a interface, it error with type not registered for interface
83 func (c *RedisCacher) logErrf(format string, contents ...interface{}) {
84 if c.Logger != nil {
85 c.Logger.Errorf(fmt.Sprintf("%s %s", LOGGING_PREFIX, format), contents...)
86 //c.Logger.Errf(fmt.Sprintf("%s %s", LOGGING_PREFIX, format), contents...)
87 }
88 }
修改后可以运行
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.