Skip to content

Commit

Permalink
Backport go-gitea#17649, fix database deadlock when update issue labels
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Nov 16, 2021
1 parent 1cec7f5 commit d2b9016
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
})();
}
});

Expand Down

0 comments on commit d2b9016

Please sign in to comment.