mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-25 06:26:35 +08:00
修复日志内容可能过长而无法存入数据库的问题
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
dbutils "github.com/TeaOSLab/EdgeAPI/internal/db/utils"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/errors"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/utils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
@@ -43,6 +44,8 @@ func init() {
|
||||
|
||||
// CreateLog 创建日志
|
||||
func (this *NodeLogDAO) CreateLog(tx *dbs.Tx, nodeRole nodeconfigs.NodeRole, nodeId int64, serverId int64, originId int64, level string, tag string, description string, createdAt int64, logType string, paramsJSON []byte) error {
|
||||
description = utils.LimitString(description, 1000)
|
||||
|
||||
// 修复以前同样的日志
|
||||
if nodeId > 0 && level == "success" && len(logType) > 0 && len(paramsJSON) > 0 {
|
||||
err := this.Query(tx).
|
||||
|
||||
Reference in New Issue
Block a user