From e489314ab915226b37944d72601c63ec7b8c9864 Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 14 Sep 2023 01:19:07 +0300 Subject: [PATCH] remove repeated commit statements --- files/helpers/lottery.py | 2 -- files/helpers/offsitementions.py | 2 -- files/helpers/roulette.py | 4 ---- 3 files changed, 8 deletions(-) diff --git a/files/helpers/lottery.py b/files/helpers/lottery.py index 79f161bb5..c9434b5b3 100644 --- a/files/helpers/lottery.py +++ b/files/helpers/lottery.py @@ -84,8 +84,6 @@ def start_new_lottery_session(): lottery.is_active = True g.db.add(lottery) - g.db.commit() # Intentionally commit early, not autocommitted from cron - def check_if_end_lottery_task(): active_lottery = get_active_lottery() diff --git a/files/helpers/offsitementions.py b/files/helpers/offsitementions.py index 8dc72893f..3e1fc0f94 100644 --- a/files/helpers/offsitementions.py +++ b/files/helpers/offsitementions.py @@ -29,8 +29,6 @@ def offsite_mentions_task(cache): user_mentions = get_mentions(cache, [query], reddit_notifs_users=True) notify_mentions(user_mentions, send_to=send_user, mention_str='mention of you') - g.db.commit() # commit early otherwise localhost testing fails to commit - def get_mentions(cache, queries, reddit_notifs_users=False): mentions = [] for kind in ('submission', 'comment'): diff --git a/files/helpers/roulette.py b/files/helpers/roulette.py index 175bacf88..071cba7d9 100644 --- a/files/helpers/roulette.py +++ b/files/helpers/roulette.py @@ -215,10 +215,6 @@ 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 = [] payouts = {}