fix up manager task number tracking
This commit is contained in:
parent
b7ddaa7a1e
commit
462715f0a6
@ -50,3 +50,6 @@ def generate_push_results(datasets):
|
|||||||
#index_file_url = push_file(index_file)
|
#index_file_url = push_file(index_file)
|
||||||
|
|
||||||
return files[0]
|
return files[0]
|
||||||
|
|
||||||
|
def check_log_for_errors(logfile):
|
||||||
|
return True
|
@ -77,7 +77,11 @@ class Runner(threading.Thread):
|
|||||||
return self._stop.isSet()
|
return self._stop.isSet()
|
||||||
|
|
||||||
def stop_worker(self, number):
|
def stop_worker(self, number):
|
||||||
self.log.debug("We've been asked to stop")
|
# Check the number is for this job instance
|
||||||
|
# (makes it possible to run multiple workers with this task
|
||||||
|
# on this server)
|
||||||
|
if number == self.job.unique:
|
||||||
|
self.log.debug("We've been asked to stop by our gearman manager")
|
||||||
self.cancelled = True
|
self.cancelled = True
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -121,7 +125,7 @@ class Runner(threading.Thread):
|
|||||||
self._do_next_step()
|
self._do_next_step()
|
||||||
self._handle_results()
|
self._handle_results()
|
||||||
|
|
||||||
# Finally, send completed packet
|
# Finally, send updated work data and completed packets
|
||||||
self._send_work_data()
|
self._send_work_data()
|
||||||
|
|
||||||
if self.work_data['result'] is 'SUCCESS':
|
if self.work_data['result'] is 'SUCCESS':
|
||||||
@ -270,7 +274,7 @@ class Runner(threading.Thread):
|
|||||||
hostname = os.uname()[1]
|
hostname = os.uname()[1]
|
||||||
self.work_data = dict(
|
self.work_data = dict(
|
||||||
name=__worker_name__,
|
name=__worker_name__,
|
||||||
number=1,
|
number=self.job.unique,
|
||||||
manager='turbo-hipster-manager-%s' % hostname,
|
manager='turbo-hipster-manager-%s' % hostname,
|
||||||
url='http://localhost',
|
url='http://localhost',
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user