Fix database deadlock when update issue labels (#17649)

This fix updates issue labels one by one, and won't cause database deadlock.
In future, we can use a batch API to update all changed labels by one request.
This commit is contained in:
wxiaoguang 2021-11-16 10:21:13 +08:00 committed by GitHub
parent 3a60e0ad89
commit 6292603215
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 26 deletions

View file

@ -332,20 +332,16 @@ export function initRepoIssueWipTitle() {
});
}
export function updateIssuesMeta(url, action, issueIds, elementId) {
return new Promise((resolve, reject) => {
$.ajax({
type: 'POST',
url,
data: {
_csrf: csrfToken,
action,
issue_ids: issueIds,
id: elementId,
},
success: resolve,
error: reject,
});
export async function updateIssuesMeta(url, action, issueIds, elementId) {
return $.ajax({
type: 'POST',
url,
data: {
_csrf: csrfToken,
action,
issue_ids: issueIds,
id: elementId,
},
});
}