]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/influx: use empty data points to signal shutting down
authorKefu Chai <kchai@redhat.com>
Mon, 22 Feb 2021 06:17:44 +0000 (14:17 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 25 Feb 2021 07:54:12 +0000 (15:54 +0800)
to appease mypy, which prefer a queue with elements of the same type.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/influx/module.py

index 4d2c46c343c7b93addce353885506957e24710ba..e71bfbcfdb7ff98593589516cd95dd6ec34a7349 100644 (file)
@@ -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()