From: Kefu Chai Date: Mon, 22 Feb 2021 06:17:44 +0000 (+0800) Subject: mgr/influx: use empty data points to signal shutting down X-Git-Tag: v17.1.0~2830^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=32bf3c1ac23f9cf7fa783bf2534a739d23e7b59c;p=ceph-ci.git mgr/influx: use empty data points to signal shutting down to appease mypy, which prefer a queue with elements of the same type. Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index 4d2c46c343c..e71bfbcfdb7 100644 --- a/src/pybind/mgr/influx/module.py +++ b/src/pybind/mgr/influx/module.py @@ -111,7 +111,7 @@ class Module(MgrModule): while True: try: points = self.queue.get() - if points is None: + if not points: self.log.debug('Worker shutting down') break @@ -387,7 +387,7 @@ class Module(MgrModule): self.log.debug('Shutting down queue workers') for _ in self.workers: - self.queue.put(None) + self.queue.put([]) self.queue.join()