mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-05-06 20:11:27 +08:00
[优化] 优化缓存
This commit is contained in:
@@ -38,15 +38,3 @@ func NewDevicePoint(pointName string, value interface{}) DevicePoint {
|
||||
UpdatedAt: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
func InitDeviceShadow(deviceName, ProductId string) Device {
|
||||
device, err := DeviceShadowInstance.GetDevice(deviceName)
|
||||
if err == UnknownDeviceErr {
|
||||
attributes := make(map[string]DevicePoint)
|
||||
telemetry := make(map[string]DevicePoint)
|
||||
device = NewDevice(deviceName, ProductId, attributes, telemetry)
|
||||
DeviceShadowInstance.AddDevice(device)
|
||||
//shadow.DeviceShadowInstance.SetDeviceTTL()
|
||||
}
|
||||
return device
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user