Skip to content

Commit

Permalink
speed up updating values
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Jul 14, 2014
1 parent 509d2c0 commit 65f5c3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def send_daily_triage!
ids = repo_subscriptions.pluck(:id)
assignments = IssueAssignment.where(repo_subscription_id: ids).where(delivered: false).limit(daily_issue_limit)
if assignments.present?
assignments.each {|a| a.update_attributes(delivered: true) }
repo_subscriptions.each {|s| s.update_attributes(last_sent_at: Time.now) }
assignments.update_all(delivered: true)
repo_subscriptions.update_all(last_sent_at: Time.now)
UserMailer.send_daily_triage(user: self, assignments: assignments).deliver
end
end
Expand Down

0 comments on commit 65f5c3c

Please sign in to comment.