| 104 | self.connection.release() |
| 105 | |
| 106 | def stop(self): |
| 107 | LOG.debug("Shutting down sensor watcher.") |
| 108 | try: |
| 109 | if self._updates_thread: |
| 110 | self._updates_thread = concurrency.kill(self._updates_thread) |
| 111 | |
| 112 | if self.connection: |
| 113 | channel = self.connection.channel() |
| 114 | bound_sensor_watch_q = self._sensor_watcher_q(channel) |
| 115 | try: |
| 116 | bound_sensor_watch_q.delete() |
| 117 | except: |
| 118 | LOG.error( |
| 119 | "Unable to delete sensor watcher queue: %s", |
| 120 | self._sensor_watcher_q, |
| 121 | ) |
| 122 | finally: |
| 123 | if self.connection: |
| 124 | self.connection.release() |
| 125 | |
| 126 | @staticmethod |
| 127 | def _get_queue(queue_suffix): |