forked from MarseyWorld/MarseyWorld
remove repeated commit statements
parent
ef906cb8da
commit
e489314ab9
|
@ -84,8 +84,6 @@ def start_new_lottery_session():
|
||||||
lottery.is_active = True
|
lottery.is_active = True
|
||||||
|
|
||||||
g.db.add(lottery)
|
g.db.add(lottery)
|
||||||
g.db.commit() # Intentionally commit early, not autocommitted from cron
|
|
||||||
|
|
||||||
|
|
||||||
def check_if_end_lottery_task():
|
def check_if_end_lottery_task():
|
||||||
active_lottery = get_active_lottery()
|
active_lottery = get_active_lottery()
|
||||||
|
|
|
@ -29,8 +29,6 @@ def offsite_mentions_task(cache):
|
||||||
user_mentions = get_mentions(cache, [query], reddit_notifs_users=True)
|
user_mentions = get_mentions(cache, [query], reddit_notifs_users=True)
|
||||||
notify_mentions(user_mentions, send_to=send_user, mention_str='mention of you')
|
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):
|
def get_mentions(cache, queries, reddit_notifs_users=False):
|
||||||
mentions = []
|
mentions = []
|
||||||
for kind in ('submission', 'comment'):
|
for kind in ('submission', 'comment'):
|
||||||
|
|
|
@ -215,10 +215,6 @@ def spin_roulette_wheel():
|
||||||
game.active = False
|
game.active = False
|
||||||
g.db.add(game)
|
g.db.add(game)
|
||||||
|
|
||||||
# Commit early when dirty because of long-running tasks after roulette
|
|
||||||
g.db.commit()
|
|
||||||
|
|
||||||
|
|
||||||
def determine_roulette_winners(number, bets):
|
def determine_roulette_winners(number, bets):
|
||||||
winners = []
|
winners = []
|
||||||
payouts = {}
|
payouts = {}
|
||||||
|
|
Loading…
Reference in New Issue