Skip to content

Commit

Permalink
fix:配置文件tdengine.dbname无效
Browse files Browse the repository at this point in the history
  • Loading branch information
zy committed Mar 1, 2024
1 parent c52d15c commit 330b23d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/logic/tdengine/td_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var dbName = "sagoo_iot"
func init() {
service.RegisterTdEngine(tdEngineNew())
// 简化配置获取过程
dbName = g.Cfg().MustGet(context.Background(), "tdengine.dbName", "sagoo_iot").String()
dbName = g.Cfg().MustGet(context.Background(), "tsd.tdengine.dbName", "sagoo_iot").String()
}

type connections struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/tsd/internal/tdengine/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (m *TdEngine) BatchInsertMultiDeviceData(multiDeviceDataList map[string][]i
if sqlBuilder.Len() > 15*1024 || i == len(multiDeviceDataList)-1 {
trimmedSQL := strings.TrimRight(sqlBuilder.String(), " ")
start := time.Now() // 开始时间
//g.Log().Debug(context.Background(), "====06====BatchInsertDeviceData SQL:", trimmedSQL)
g.Log().Debug(context.Background(), "====06====BatchInsertDeviceData SQL:", trimmedSQL)
_, err := m.db.Exec(trimmedSQL)
if err != nil {
g.Log().Error(context.Background(), err.Error(), trimmedSQL)
Expand Down

0 comments on commit 330b23d

Please sign in to comment.