1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-09 21:05:47 +00:00

Backport #17649, fix database deadlock when update issue labels (#17665)

This commit is contained in:
wxiaoguang 2021-11-17 13:32:31 +08:00 committed by GitHub
parent ea0fe83888
commit 6cd1ccef3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -408,18 +408,17 @@ function initCommentForm() {
$(`.${selector}`).dropdown('setting', 'onHide', () => {
hasUpdateAction = $listMenu.data('action') === 'update'; // Update the var
if (hasUpdateAction) {
const promises = [];
Object.keys(items).forEach((elementId) => {
const item = items[elementId];
const promise = updateIssuesMeta(
item['update-url'],
item.action,
item['issue-id'],
elementId,
);
promises.push(promise);
});
Promise.all(promises).then(reload);
(async function() {
for (const [elementId, item] of Object.entries(items)) {
await updateIssuesMeta(
item['update-url'],
item.action,
item['issue-id'],
elementId,
);
}
window.location.reload();
})();
}
});