Skip to content

Commit 70eea54

Browse files
committed
Prevents inactive repos from beeing suggested in the poke_inactive mail
1 parent 7d11b30 commit 70eea54

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/mailers/user_mailer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ def send_triage(user:, assignment:, repo:, create: false)
7777

7878
def poke_inactive(user:, repos_by_need_ids:)
7979
return unless set_and_check_user(user)
80-
@most_repo = Repo.order_by_issue_count.first
80+
@most_repo = Repo.active.order_by_issue_count.first
8181

8282
repo_need_id = repos_by_need_ids.detect { |id| id != @most_repo.id }
8383
@need_repo = Repo.where(id: repo_need_id).first
8484

85-
@random_repo = Repo.rand.not_in(@most_repo.id, @need_repo.id).first || @most_repo || @need_repo
85+
@random_repo = Repo.active.rand.not_in(@most_repo.id, @need_repo.id).first || @most_repo || @need_repo
8686
mail(to: @user.email, reply_to: "[email protected]", subject: "CodeTriage misses you")
8787
end
8888

lib/tasks/schedule.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace :schedule do
6161
task poke_inactive: :environment do
6262
next unless Date.today.tuesday?
6363

64-
repos_by_need_ids = Repo.order_by_need.limit(10).pluck(:id)
64+
repos_by_need_ids = Repo.active.order_by_need.limit(10).pluck(:id)
6565
User.inactive.find_each(batch_size: 100) do |user|
6666
BackgroundInactiveEmailJob.perform_later(user, repos_by_need_ids: repos_by_need_ids)
6767
end

0 commit comments

Comments
 (0)