summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-04-02 20:09:03 (GMT)
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-04-02 20:09:03 (GMT)
commitb4ba2de55ee1e0eba619d6cfa39478185f7029d7 (patch)
tree110b8e06b99239579d165b5d9689ff6c096337c3
parent05899546f79d9604e1d6cd0ab718fdc670770579 (diff)
downloadmorph-baserock/pedroalvarez/gear-wip.tar.gz
Change-Id: Ib154b10c19a8da85ead20c0c6fc80158b5c994b0
-rw-r--r--gear/controller.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/gear/controller.py b/gear/controller.py
index 56022f0..0e0a9d4 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()