-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Every time I send a message through the send_notification function, the thread is still not over even if I disconnect.
Do I have to manually close the current thread?
self.device_hive_api = DeviceHiveApi(self.rest_url, login=self.login, password=self.password)
while need_send_to_device_hive:
msg = need_send_to_device_hive.pop()
try:
self.device_hive_api.send_notification(device_id, msg['notification'], msg['parameters'])
# logging.info(msg['notification'], result.timestamp)
except Exception as e:
msg = {
"notification": "error",
"parameters": {
"msg": str(e)
}
}
need_send_to_device_hive.append(msg)
self.device_hive_api = DeviceHiveApi(self.rest_url, login=self.login, password=self.password)
self.device_hive_api.disconnect()
threading.Timer(1, self.send_notification).start()