Skip to content

Commit

Permalink
Merge pull request #29 from ZyRiven/fix-tsd-dbname
Browse files Browse the repository at this point in the history
Fix tsd dbname
  • Loading branch information
xinjiayu authored Mar 1, 2024
2 parents 8e739b7 + 02f9d7e commit 172573e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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
4 changes: 2 additions & 2 deletions pkg/tsd/internal/tdengine/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (m *TdEngine) BatchInsertDeviceData(deviceKey string, deviceDataList []iotM
if sqlBuilder.Len() > 15*1024 || i == len(deviceDataList)-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 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 172573e

Please sign in to comment.