From e52fc4eb9e23c2cd89595bfc6338cd24922c0d72 Mon Sep 17 00:00:00 2001 From: TLSM Date: Thu, 29 Sep 2022 13:45:13 -0400 Subject: [PATCH] cron: commit roulette txn early for long tasks. --- files/helpers/roulette.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/helpers/roulette.py b/files/helpers/roulette.py index c06923b2b..6feccd733 100644 --- a/files/helpers/roulette.py +++ b/files/helpers/roulette.py @@ -202,6 +202,9 @@ def spin_roulette_wheel(): game.active = False g.db.add(game) + # Commit early when dirty because of long-running tasks after roulette + g.db.commit() + def determine_roulette_winners(number, bets): winners = []