fix:deadlock und doppelte Mails
This commit is contained in:
1 parent
b1531e41e1
commit
8b6f74f364
13 files changed
+69
-27
No files matched your search
@@ -57,7 +57,10 @@ def _capacity(question: Question, option_id: str) -> int | None:
|
||||
|
||||
|
||||
def _lock(db: Session, question: Question) -> None:
|
||||
db.execute(select(Question.id).where(Question.id == question.id).with_for_update())
|
||||
# FOR NO KEY UPDATE: sperrt gleichzeitige Buchungen gegeneinander, aber nicht gegen
|
||||
# Fremdschlüssel-Prüfungen (Antworten auf diese Frage); FOR UPDATE führte zu Deadlocks
|
||||
db.execute(select(Question.id).where(Question.id == question.id)
|
||||
.with_for_update(key_share=True))
|
||||
|
||||
|
||||
def _counts(db: Session, question: Question) -> dict[tuple[str, str], int]:
|
||||
|
||||
Reference in new issue
Block a user