feat ✨ 去除数据库写log对queue驱动的依赖,调整cache,分离出queue和locker
This commit is contained in:
1 parent
3df83cb057
commit
e40047a88e
8 files changed
+35
-15
No files matched your search
@@ -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())
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user