diff --git a/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py b/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py index 3dc325a..3bac8c6 100644 --- a/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py +++ b/turbo_hipster/task_plugins/gate_real_db_upgrade/handle_results.py @@ -50,3 +50,6 @@ def generate_push_results(datasets): #index_file_url = push_file(index_file) return files[0] + +def check_log_for_errors(logfile): + return True \ No newline at end of file diff --git a/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py b/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py index 195f696..be6a3c2 100644 --- a/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py +++ b/turbo_hipster/task_plugins/gate_real_db_upgrade/task.py @@ -77,8 +77,12 @@ class Runner(threading.Thread): return self._stop.isSet() def stop_worker(self, number): - self.log.debug("We've been asked to stop") - self.cancelled = True + # 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 def run(self): while True and not self.stopped(): @@ -121,7 +125,7 @@ class Runner(threading.Thread): self._do_next_step() self._handle_results() - # Finally, send completed packet + # Finally, send updated work data and completed packets self._send_work_data() if self.work_data['result'] is 'SUCCESS': @@ -270,7 +274,7 @@ class Runner(threading.Thread): hostname = os.uname()[1] self.work_data = dict( name=__worker_name__, - number=1, + number=self.job.unique, manager='turbo-hipster-manager-%s' % hostname, url='http://localhost', )