mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: retry transactions who fail due to deadlocks
In my opinion, this kind of handling of transactions is pretty ugly. The being said, we have issues with running into deadlocks on aur.al, so this commit works against that immediate bug. An ideal solution would be to deal with retrying transactions through the `db.begin()` scope, so we wouldn't have to explicitly annotate functions as "retry functions," which is what this commit does. Closes #376 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
f450b5dfc7
commit
ec3152014b
16 changed files with 241 additions and 82 deletions
|
@ -106,6 +106,7 @@ def remove_comaintainer(
|
|||
return notif
|
||||
|
||||
|
||||
@db.retry_deadlock
|
||||
def remove_comaintainers(pkgbase: PackageBase, usernames: list[str]) -> None:
|
||||
"""
|
||||
Remove comaintainers from `pkgbase`.
|
||||
|
@ -155,6 +156,7 @@ class NoopComaintainerNotification:
|
|||
return
|
||||
|
||||
|
||||
@db.retry_deadlock
|
||||
def add_comaintainer(
|
||||
pkgbase: PackageBase, comaintainer: User
|
||||
) -> notify.ComaintainerAddNotification:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue