Skip to content

Commit

Permalink
Update care/facility/tasks/asset_monitor.py
Browse files Browse the repository at this point in the history
Co-authored-by: Aakash Singh <[email protected]>
  • Loading branch information
Ashesh3 and sainak authored Jul 17, 2023
1 parent 509fffa commit 3513644
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions care/facility/tasks/asset_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ def check_asset_status():
"middleware_hostname",
asset.current_location.facility.middleware_address,
)
asset_class: BaseAssetIntegration = AssetClasses[asset.asset_class].value(
{
**asset.meta,
"middleware_hostname": hostname,
}
)
result: Any = {}

if hostname in middleware_status_cache:
result = middleware_status_cache[hostname]
else:
try:
asset_class: BaseAssetIntegration = AssetClasses[asset.asset_class].value(
{
**asset.meta,
"middleware_hostname": hostname,
}
)
result = asset_class.api_get(asset_class.get_url("devices/status"))
middleware_status_cache[hostname] = result
except Exception as e:
Expand Down

0 comments on commit 3513644

Please sign in to comment.