Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: 补充node_callback的日志 #7117

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions gcloud/apigw/views/node_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@


import ujson as json
from apigw_manager.apigw.decorators import apigw_require
from blueapps.account.decorators import login_exempt
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST

from blueapps.account.decorators import login_exempt
from gcloud import err_code
from gcloud.apigw.decorators import mark_request_whether_is_trust, return_json_response
from gcloud.apigw.decorators import project_inject
from gcloud.taskflow3.models import TaskFlowInstance
from gcloud.apigw.decorators import mark_request_whether_is_trust, project_inject, return_json_response
from gcloud.apigw.views.utils import logger
from gcloud.iam_auth.intercept import iam_intercept
from gcloud.iam_auth.view_interceptors.apigw import TaskOperateInterceptor
from apigw_manager.apigw.decorators import apigw_require
from gcloud.taskflow3.models import TaskFlowInstance


@login_exempt
Expand All @@ -42,7 +41,7 @@ def node_callback(request, task_id, project_id):
return {"result": False, "message": "invalid json format", "code": err_code.REQUEST_PARAM_INVALID.code}

project = request.project

logger.info("[apigw][node_callback] receive a node callback request, task_id={}, params={}".format(task_id, params))
try:
task = TaskFlowInstance.objects.get(id=task_id, project_id=project.id)
except TaskFlowInstance.DoesNotExist:
Expand All @@ -59,4 +58,7 @@ def node_callback(request, task_id, project_id):
callback_data = params.get("callback_data")
version = params.get("version")

return task.callback(node_id, callback_data, version)
logger.info("[apigw][node_callback] node_callback start, task_id={}".format(task_id))
result = task.callback(node_id, callback_data, version)
logger.info("[apigw][node_callback] node_callback finished, task_id={}".format(task_id))
return result
Loading