Giter VIP home page Giter VIP logo

xorm-redis-cache's People

Contributors

junpayment avatar lunny avatar nashtsai avatar sleagon avatar vlorc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xorm-redis-cache's Issues

gob 序列化问题

[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缓存好久不更新了,有生成使用的例子嘛?

兼容性问题 core.Logger 不再支持Errf 而是 Errorf

 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 }

修改后可以运行

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.