我需要使用 Azure devops python Api 编写近 300 个不同的 wiki 页面,所有页面均按类型分类:[Epic、Features、....]
当我逐一编写它们时,这会花费我很多时间
所以我尝试做一个基本的多线程
if (multithreading):
threads = []
for task in task_list:
thread = threading.Thread(target=write_one_epic, args=(task, requests_session)
thread.start()
threads.append(thread)
for thread in threads:
thread.join()
这导致我出现此错误
The wiki page operation failed with message : TF401028: The reference 'refs/heads/wikiMaster' has already been updated by another client, so you cannot update it. Please try again.
更新,我尝试了ThreadPoolExecutor
,但结果还是同样的错误
当我尝试创建新页面时出现错误
wiki.create_or_update_page(content, Constant.project, Constant.wikiIdentifier, self.actual_path, None)