EPG Update Bugfix

This commit is contained in:
deathbybandaid 2020-12-16 08:27:51 -05:00
parent 1eb2720347
commit 0e2da84138

View File

@ -296,10 +296,18 @@ class EPG():
while True:
for epg_method in self.epg_methods:
last_update_time = self.fhdhr.db.get_fhdhr_value("update_time", epg_method)
updatetheepg = False
if not last_update_time:
self.fhdhr.web.session.get(self.epg_update_url)
updatetheepg = True
elif time.time() >= (last_update_time + self.sleeptime[epg_method]):
self.fhdhr.web.session.get(self.epg_update_url)
time.sleep(360)
updatetheepg = True
if updatetheepg:
try:
self.fhdhr.web.session.get(self.epg_update_url, timeout=0.0000000001)
except self.fhdhr.web.exceptions.ReadTimeout:
pass
except self.fhdhr.web.exceptions.ConnectionError as e:
self.fhdhr.logger.error("Error updating %s EPG cache: %s" % (epg_method, e))
time.sleep(1800)
except KeyboardInterrupt:
pass