I have a simple app which queries an address for data. It ends up having items queued on the thread queue (5+) and I am wondering how to debug it. This happens very infrequently maybe once a week and enabling logging has not helped. As of writing this post, the queue size is 5 (Last Active=2020-12-06T12:05:26-06:00). Once this happens, I have to restart AppDaemon completely. I feel I am missing something very obvious.
class Updater(hass.Hass):
def initialize(self):
...
self.fetchData()
def terminate(self):
if self.callback:
self.cancel_timer(self.callback)
self.callback = None
def fetchData(self, kwargs=None):
self.callback = None
try:
data = requests.get(self.url).text
...
except () as error:
self.log(f"Error connecting to {self.garage_address}.")
finally:
self.callback = self.run_in(self.fetchData, FETCH_INTERVAL)