[优化] 优化缓存

This commit is contained in:
PandaX
2023-10-17 14:39:01 +08:00
parent 5db1db8289
commit 10b98df33c
17 changed files with 158 additions and 85 deletions

View File

@@ -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
}