MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / update_task_progress

Method update_task_progress

client/util/reporter.py:75–101  ·  view source on GitHub ↗

向server上报,更新任务执行进度 :param info: 上报信息Info实例 :return:

(self, info)

Source from the content-addressed store, hash-verified

73 self._task_scene = task_params.get('task_scene', None)
74
75 def update_task_progress(self, info):
76 """向server上报,更新任务执行进度
77
78 :param info: 上报信息Info实例
79 :return:
80 """
81 # test任务无需上报,直接返回
82 if self._task_scene and self._task_scene in [TaskScene.TEST]:
83 return
84 if QuickScan.is_quick_scan():
85 return
86 try:
87 # 从param中获取server_url
88 server_url = self._task_params.get("server_url", None)
89 # 从param中获取token并解密
90 encrypted_token = self._task_params.get("token", None)
91 token = Crypto(settings.PASSWORD_KEY).decrypt(encrypted_token)
92
93 dog_server = RetryDogServer(server_url, token).get_api_server(retry_times=0)
94 # 非节点模式,NODE_ID字段传参为None
95 node_id = persist_data.get('NODE_ID') if self._task_scene == TaskScene.NORMAL else None
96 dog_server.update_task_progress(self._task_params,
97 node_id,
98 info.message,
99 info.percent)
100 except Exception as err:
101 logger.exception('Update_task_progress fail. upload msg:%s', info.message)

Callers 13

cache_reportMethod · 0.45
update_reportMethod · 0.45
update_retry_reportMethod · 0.45
checkout_reportMethod · 0.45
runnerMethod · 0.45
runnerMethod · 0.45
runnerMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
_send_resultMethod · 0.45

Calls 6

RetryDogServerClass · 0.90
is_quick_scanMethod · 0.80
exceptionMethod · 0.80
getMethod · 0.45
decryptMethod · 0.45
get_api_serverMethod · 0.45

Tested by

no test coverage detected