diff options
Diffstat (limited to 'gear/controller.py')
-rw-r--r-- | gear/controller.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gear/controller.py b/gear/controller.py index 56022f08..0e0a9d43 100644 --- a/gear/controller.py +++ b/gear/controller.py @@ -7,6 +7,7 @@ import time import signal import urlparse import distbuild +import gearman #TODO: values from settings cache_server = 'http://cache.baserock.org:8080' @@ -294,6 +295,7 @@ class RequestsController(threading.Thread): self.cancel_client.addServer('localhost') self.cancel_client.waitForServer() + def add_request(self, request, job=None): json_request = json.dumps(request) print "DEBUG: adding request - %s" % json_request @@ -453,10 +455,12 @@ requests_manager.start() time.sleep(15) print "START CANCELATION" requests_controller.cancel_request(1) +gm_admin_client = gearman.GearmanAdminClient(['localhost:4730']) while not requests_controller.stopped: try: - time.sleep(3) + print gm_admin_client.get_status() + time.sleep(1) except KeyboardInterrupt: print "Ctrl + C: asking tasks to exit nicely...\n" requests_manager.shutdown() |