File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,10 @@ func init() {
5454 interval , _ := rulesMap ["interval" ].(json.Number ).Int64 ()
5555 if interval == int64 (0 ) {
5656 //单次触发
57+ if _ , ok := rulesMap ["time" ].(string ); ! ok {
58+ logs .Error ("时间触发配置中缺少时间参数" )
59+ continue
60+ }
5761 ruleTime , err := time .Parse (format0 , rulesMap ["time" ].(string ))
5862 logs .Info ("单次触发" , ruleTime , "比对" , now0 )
5963 if err == nil && ruleTime .Equal (now0 ) {
Original file line number Diff line number Diff line change @@ -1010,8 +1010,10 @@ func (*DeviceService) GetDeviceOnlineStatus(deviceIdList valid.DeviceIdListValid
10101010 var deviceOnlineStatus = make (map [string ]interface {})
10111011 for _ , deviceId := range deviceIdList .DeviceIdList {
10121012 var tskvLatest models.TSKVLatest
1013- result := psql .Mydb .Where ("entity_id = ? and key = 'SYS_ONLINE'" , deviceId ).First (& tskvLatest )
1014- if result != nil {
1013+ result := psql .Mydb .Model (& models.TSKVLatest {}).Where ("entity_id = ? and key = 'SYS_ONLINE'" , deviceId ).First (& tskvLatest )
1014+ logs .Info ("------------------------------------------------ceshi" )
1015+ if result .Error != nil {
1016+ logs .Error (result .Error )
10151017 deviceOnlineStatus [deviceId ] = "0"
10161018 } else {
10171019 deviceOnlineStatus [deviceId ] = tskvLatest .StrV
You can’t perform that action at this time.
0 commit comments