fix admin login log
CI / changes (push) Successful in 4s
CI / docker-bff (push) Successful in 3m21s
CI / docker-product (push) Successful in 3m39s
CI / docker-admin (push) Successful in 3m34s
CI / docker-user (push) Successful in 3m29s
CI / docker-ad (push) Successful in 3m29s
CI / changes (push) Successful in 4s
CI / docker-bff (push) Successful in 3m21s
CI / docker-product (push) Successful in 3m39s
CI / docker-admin (push) Successful in 3m34s
CI / docker-user (push) Successful in 3m29s
CI / docker-ad (push) Successful in 3m29s
This commit is contained in:
@@ -81,7 +81,6 @@ func (w *LogWatcher) loopActionLog() {
|
||||
continue
|
||||
}
|
||||
|
||||
ctxBg := context.Background()
|
||||
logTime, _ := utils.ParseCustomTime(action.CreateTime)
|
||||
edit := dao.ActionLog{
|
||||
Content: action.Content,
|
||||
@@ -100,7 +99,7 @@ func (w *LogWatcher) loopActionLog() {
|
||||
err = model.ActionModel{}.Init().Create(&edit)
|
||||
if err != nil {
|
||||
logx.Errorf("insert actionlog mysql err=%v payload=%s", err, payload)
|
||||
_ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogActionQueueKey, payload).Err()
|
||||
// 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
@@ -147,8 +146,6 @@ func (w *LogWatcher) loopLoginLog() {
|
||||
continue
|
||||
}
|
||||
|
||||
ctxBg := context.Background()
|
||||
|
||||
logTime, _ := utils.ParseCustomTime(login.CreateTime)
|
||||
edit := dao.LoginLog{
|
||||
AdminId: login.AdminId,
|
||||
@@ -164,7 +161,7 @@ func (w *LogWatcher) loopLoginLog() {
|
||||
err = model.LoginModel{}.Init().Create(&edit)
|
||||
if err != nil {
|
||||
logx.Errorf("insert loginlog mysql err=%v payload=%s", err, payload)
|
||||
_ = logRedis.LogRedisClient.LPush(ctxBg, utils.LogLoginQueueKey, payload).Err()
|
||||
// 删除 LPush 重试逻辑,报错仅打印日志直接丢弃,不再回写队列
|
||||
time.Sleep(500 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user