def execute_task(task_queue, execution_id, execution_parameters): celery = celery_client.get_client() try: return celery.execute_task(task_queue=task_queue, task_id=execution_id, kwargs=execution_parameters) finally: celery.close()
def _execute_task(task_queue, execution_id, execution_parameters, context): context['rest_token'] = current_user.get_auth_token() context['tenant_name'] = current_app.config[CURRENT_TENANT_CONFIG].name execution_parameters['__cloudify_context'] = context celery = celery_client.get_client() try: return celery.execute_task(task_queue=task_queue, task_id=execution_id, kwargs=execution_parameters) finally: celery.close()
def _execute_task(execution_id, execution_parameters, context): context['rest_token'] = current_user.get_auth_token() context['tenant'] = _get_tenant_dict() context['task_target'] = MGMTWORKER_QUEUE execution_parameters['__cloudify_context'] = context celery = celery_client.get_client() try: return celery.execute_task(task_queue=MGMTWORKER_QUEUE, task_id=execution_id, kwargs=execution_parameters) finally: celery.close()