Remove telemetry status files
@@ -215,7 +215,6 @@ class Watcher:
mod_time = os.path.getmtime(sf)
curr_time = int(time.time())
if (curr_time - mod_time < 300):
-
with open(sf) as json_file:
try:
status_data = json.load(json_file)
@@ -231,6 +230,11 @@ class Watcher:
except Exception as e:
self._hutil_log("Error parsing telemetry status file: "+sf)
self._hutil_log("Exception info: "+traceback.format_exc())
+ try:
+ os.remove(sf)
+ except Exception as e:
+ self._hutil_log("Error removing telemetry status file: "+ sf)
+ self._hutil_log("Exception info: " + traceback.format_exc())
else:
self._hutil_log("Telemetry status file not updated in last 5 mins: "+sf)
else:
