From b4ba2de55ee1e0eba619d6cfa39478185f7029d7 Mon Sep 17 00:00:00 2001 From: Pedro Alvarez Date: Sat, 2 Apr 2016 20:09:03 +0000 Subject: wip Change-Id: Ib154b10c19a8da85ead20c0c6fc80158b5c994b0 --- gear/controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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() -- cgit v1.2.1