[deploy] Refactor:Move Tag Badge and Github Badge Awards to Sidekiq (#9885)

This commit is contained in:
Molly Struve 2020-08-20 08:41:36 -05:00 committed by GitHub
parent ec4d373ea0
commit ae4080a6ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View file

@ -45,3 +45,17 @@ award_sixteen_week_streak_badge:
- ""
- award_sixteen_week_streak_badge
- ""
award_weekly_tag_badges:
cron: "0 11 * * 4" # 11 am UTC every Thursday
class: "BadgeAchievements::BadgeAwardWorker"
args:
- ""
- award_tag_badges
- ""
award_contributor_badges_from_github:
cron: "20 * * * *" # every hour, 20 min after the hour
class: "BadgeAchievements::BadgeAwardWorker"
args:
- ""
- award_contributor_badges_from_github
- ""

View file

@ -1,11 +1,3 @@
task award_weekly_tag_badges: :environment do
# Should run once per week.
# Scheduled "daily" on Heroku Scheduler, should only fully run on Thursday.
if Time.current.wday == 4
BadgeRewarder.award_tag_badges
end
end
# rake award_top_seven_badges["ben jess peter mac liana andy"]
task :award_top_seven_badges, [:arg1] => :environment do |_t, args|
usernames = args[:arg1].split(" ")
@ -29,8 +21,3 @@ task :award_fab_five_badges, [:arg1] => :environment do |_t, args|
BadgeRewarder.award_fab_five_badges(usernames)
puts "Done!"
end
# this task is meant to be scheduled daily
task award_contributor_badges_from_github: :environment do
BadgeRewarder.award_contributor_badges_from_github
end