feat ✨ 去除数据库写log对queue驱动的依赖,调整cache,分离出queue和locker

This commit is contained in:
linwenxiang committed 2021-04-20 11:08:46 +08:00
1 parent 3df83cb057
commit e40047a88e
8 files changed
+35 -15

No files matched your search

+1 -1
View File
@@ -125,7 +125,7 @@ func LoginLogToDB(c *gin.Context, status string, msg string, username string) {
l["username"] = username
l["msg"] = msg
q := sdk.Runtime.GetCachePrefix(c.Request.Host)
q := sdk.Runtime.GetMemoryQueue(c.Request.Host)
message, err := sdk.Runtime.GetStreamMessage("", global.LoginLog, l)
if err != nil {
log.Errorf("GetStreamMessage error, %s", err.Error())
+5 -1
View File
@@ -24,6 +24,10 @@ func LoggerToFile() gin.HandlerFunc {
// 处理请求
c.Next()
if strings.Index(c.Request.RequestURI, "/api/v1/logout") > -1 ||
strings.Index(c.Request.RequestURI, "/login") > -1 {
return
}
// 结束时间
endTime := time.Now()
if c.Request.Method == http.MethodOptions {
@@ -118,7 +122,7 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string
} else {
l["status"] = "1"
}
q := sdk.Runtime.GetCachePrefix(c.Request.Host)
q := sdk.Runtime.GetMemoryQueue(c.Request.Host)
message, err := sdk.Runtime.GetStreamMessage("", global.OperateLog, l)
if err != nil {
log.Errorf("GetStreamMessage error, %s", err.Error())