From 32bf3c1ac23f9cf7fa783bf2534a739d23e7b59c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 22 Feb 2021 14:17:44 +0800 Subject: [PATCH] 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 --- src/pybind/mgr/influx/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/influx/module.py b/src/pybind/mgr/influx/module.py index 4d2c46c343c7b..e71bfbcfdb7ff 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() -- 2.39.5