Commit 09f96729 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Minor fixes to proc cli.

parent 6cbd7b56
Pipeline #45333 passed with stages
in 24 minutes and 56 seconds
......@@ -67,7 +67,12 @@ def stop_all(calcs: bool, kill: bool):
kwargs = {}
if kill:
kwargs.update(signal='SIGKILL')
processing.app.control.revoke(proc.celery_task_id, terminate=True, **kwargs)
try:
processing.app.control.revoke(proc.celery_task_id, terminate=True, **kwargs)
except Exception as e:
logger.warning(
'could not revoke celery task', exc_info=e,
celery_task_id=proc.celery_task_id, **logger_kwargs)
if kill:
logger.info(
'fail proc', celery_task_id=proc.celery_task_id, kill=kill,
......@@ -75,6 +80,7 @@ def stop_all(calcs: bool, kill: bool):
proc.fail('process terminate via nomad cli')
proc.process_status = processing.PROCESS_COMPLETED
proc.on_process_complete(None)
proc.save()
query = Q(process_status=processing.PROCESS_RUNNING) | Q(tasks_status=processing.RUNNING)
......
......@@ -302,7 +302,7 @@ class Proc(Document, metaclass=ProcMetaclass):
self.reload()
def __str__(self):
return 'proc celery_task_id=%s worker_host=%s' % (self.celery_task_id, self.worker_host)
return 'proc celery_task_id=%s worker_hostname=%s' % (self.celery_task_id, self.worker_hostname)
def task(func):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment