Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send notification #53

Open
CodePythonFollow opened this issue Dec 23, 2020 · 0 comments
Open

send notification #53

CodePythonFollow opened this issue Dec 23, 2020 · 0 comments

Comments

@CodePythonFollow
Copy link

CodePythonFollow commented Dec 23, 2020

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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant