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

Method __retry_update

client/task/sourcemgr.py:343–365  ·  view source on GitHub ↗

已有代码目录缓存,更新代码;如果失败,重新拉取;如果再失败,删除目录后重新拉取 :return:

(self)

Source from the content-addressed store, hash-verified

341 self.__retry_checkout(scm_mgr)
342
343 def __retry_update(self):
344 """
345 已有代码目录缓存,更新代码;如果失败,重新拉取;如果再失败,删除目录后重新拉取
346 :return:
347 """
348 sm = SCMMgr(self.params)
349 try:
350 # 上报进度
351 SourceReporter(self.task_type, self.params).update_report()
352 # 如果未开启拉取子模块开关,先清理缓存代码目录中的子模块
353 if self.params.get("ignore_submodule_clone", False) is True:
354 logger.info("clean submodules before update source ...")
355 sm.get_scm_client().clean_submodules()
356 sm.get_scm_client().update(revision=self.params["scm_revision"],
357 enable_submodules=self.enable_submodules,
358 enable_lfs=self.enable_lfs)
359 except ScmCommandError:
360 logger.exception("update code failed, will retry to checkout after 30s ...")
361 time.sleep(30)
362 # 上报进度
363 SourceReporter(self.task_type, self.params).update_retry_report()
364 sm.get_scm_client().remove()
365 self.__retry_checkout(sm)
366
367 def __retry_checkout(self, scm_mgr):
368 """

Callers 2

__checkout_dataMethod · 0.95

Calls 11

__retry_checkoutMethod · 0.95
SourceReporterClass · 0.85
update_reportMethod · 0.80
get_scm_clientMethod · 0.80
exceptionMethod · 0.80
update_retry_reportMethod · 0.80
getMethod · 0.45
infoMethod · 0.45
clean_submodulesMethod · 0.45
updateMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected