Skip to content
This repository has been archived by the owner on Jul 25, 2018. It is now read-only.

Commit

Permalink
Use single transaction for leaderboard update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kelly committed Feb 1, 2015
1 parent 5a0a6c2 commit b9d6a34
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions affiliates/links/management/commands/update_leaderboard.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.contrib.auth.models import User
from django.db import transaction
from django.db.models import Sum

from affiliates.base.management.commands import QuietCommand
Expand All @@ -8,6 +9,7 @@
class Command(QuietCommand):
help = ('Populate the leaderboard with the latest rankings.')

@transaction.commit_on_success
def handle_quiet(self, *args, **kwargs):
# Collect the sum of aggregated clicks stored in related Links
# for each user.
Expand Down

0 comments on commit b9d6a34

Please sign in to comment.