Skip to content

send notification #53

@CodePythonFollow

Description

@CodePythonFollow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions