Skip to content

Commit

Permalink
be smarter about refresh bounties, de-dupe refresh_remote_bounties fr…
Browse files Browse the repository at this point in the history
…om cleanup_dupe_bounties
  • Loading branch information
owocki committed Jul 12, 2019
1 parent 99b1fca commit 3eca86f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/management/commands/set_user_personas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.core.management.base import BaseCommand
from django.utils import timezone

from dashboard.models import Profile, UserAction
from django.utils import timezone


class Command(BaseCommand):
Expand Down
5 changes: 4 additions & 1 deletion app/economy/management/commands/refresh_bounties.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import time

from django.core.management.base import BaseCommand

from dashboard.models import Bounty
Expand Down Expand Up @@ -46,7 +48,7 @@ def handle(self, *args, **options):
Defaults to: `False` unless user passes the remote option.
"""
all_bounties = Bounty.objects.filter(current_bounty=True)
all_bounties = Bounty.objects.filter(current_bounty=True).order('-pk')

This comment has been minimized.

Copy link
@owocki

owocki Jul 29, 2019

Author Contributor
fetch_remote = options['remote']
print(f"refreshing {all_bounties.count()} bounties")

Expand All @@ -63,6 +65,7 @@ def handle(self, *args, **options):
bounty.fetch_issue_item('title')
bounty.fetch_issue_item()
bounty.fetch_issue_comments()
time.sleep(10)
print('1/ refreshed', bounty.pk)
except Exception as e:
print(e)
Expand Down

0 comments on commit 3eca86f

Please sign in to comment.