Browse Source

Cosmetics

Ask Solem 12 years ago
parent
commit
420c8f344d
1 changed files with 5 additions and 3 deletions
  1. 5 3
      celery/worker/__init__.py

+ 5 - 3
celery/worker/__init__.py

@@ -320,9 +320,7 @@ class WorkController(configurated):
         self._finalize = Finalize(self, self.stop, exitpriority=1)
         self.pidfile = pidfile
         self.pidlock = None
-        self.use_eventloop = (detect_environment() == 'default' and
-                              self.app.connection().is_evented and
-                              not self.app.IS_WINDOWS)
+        self.use_eventloop = self.should_use_eventloop()
 
         # Update celery_include to have all known task modules, so that we
         # ensure all task modules are imported in case an execv happens.
@@ -388,6 +386,10 @@ class WorkController(configurated):
         except AttributeError:
             pass
 
+    def should_use_eventloop(self):
+        return (detect_environment() == 'default' and
+                self.app.connection().is_evented and not self.app.IS_WINDOWS)
+
     def stop(self, in_sighandler=False):
         """Graceful shutdown of the worker server."""
         self.signal_consumer_close()