mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
BE/PLG: TZ timestamp work #1251
Some checks failed
docker / docker_dev (push) Has been cancelled
Some checks failed
docker / docker_dev (push) Has been cancelled
This commit is contained in:
@@ -532,6 +532,16 @@ def update_devices_names(pm):
|
|||||||
# Retrieve last time name resolution was checked
|
# Retrieve last time name resolution was checked
|
||||||
last_checked = pm.name_plugins_checked
|
last_checked = pm.name_plugins_checked
|
||||||
|
|
||||||
|
# Normalize last_checked to datetime if it's a string
|
||||||
|
if isinstance(last_checked, str):
|
||||||
|
try:
|
||||||
|
last_checked = parser.parse(last_checked)
|
||||||
|
except Exception as e:
|
||||||
|
mylog('none', f'[Update Device Name] Could not parse last_checked timestamp: {last_checked!r} ({e})')
|
||||||
|
last_checked = None
|
||||||
|
elif not isinstance(last_checked, datetime.datetime):
|
||||||
|
last_checked = None
|
||||||
|
|
||||||
# Collect and normalize valid state update timestamps for name-related plugins
|
# Collect and normalize valid state update timestamps for name-related plugins
|
||||||
state_times = []
|
state_times = []
|
||||||
latest_state = None
|
latest_state = None
|
||||||
|
|||||||
Reference in New Issue
Block a user