redis prefix modify

pull/103/head
Gordon 3 years ago
parent 5cd1af5b48
commit e6b5819099

@ -127,7 +127,7 @@ func OpenIMRegister(account string) (*http.Response, error) {
params := make(map[string]interface{})
params["secret"] = config.Config.Secret
params["platform"] = 7
params["platform"] = 2
params["uid"] = account
params["name"] = account
params["icon"] = ""

@ -11,7 +11,7 @@ const (
appleDeviceToken = "DEVICE_TOKEN"
lastGetSeq = "LAST_GET_SEQ"
userMinSeq = "REDIS_USER_MIN_SEQ:"
uidPidToken = "UID_PID_TOKEN:"
uidPidToken = "UID_PID_TOKEN_STATUS:"
)
func (d *DataBases) Exec(cmd string, key interface{}, args ...interface{}) (interface{}, error) {

@ -61,19 +61,18 @@ func newEsHook(moduleName string) *esHook {
return &esHook{client: es, moduleName: moduleName}
}
//Fire log hook interface 方法
//Fire log hook interface
func (hook *esHook) Fire(entry *logrus.Entry) error {
doc := newEsLog(entry)
go hook.sendEs(doc)
return nil
}
//Levels log hook interface 方法,此hook影响的日志
func (hook *esHook) Levels() []logrus.Level {
return logrus.AllLevels
}
//sendEs 异步发送日志到es
//sendEs
func (hook *esHook) sendEs(doc appLogDocModel) {
defer func() {
if r := recover(); r != nil {
@ -102,7 +101,7 @@ func newEsLog(e *logrus.Entry) appLogDocModel {
return ins
}
// indexName es index name 时间分割
// indexName es index name
func (m *appLogDocModel) indexName() string {
return time.Now().Format("2006-01-02")
}

Loading…
Cancel
Save