Small efficiency adjustments (#20782)
This commit is contained in:
parent
01b55c646b
commit
c3c8b5f9c4
2 changed files with 3 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ class BillboardEventsController < ApplicationMetalController
|
|||
def update_billboards_data
|
||||
billboard_event_id = billboard_event_params[:billboard_id]
|
||||
|
||||
ThrottledCall.perform("billboards_data_update-#{billboard_event_id}", throttle_for: 15.minutes) do
|
||||
ThrottledCall.perform("billboards_data_update-#{billboard_event_id}", throttle_for: 25.minutes) do
|
||||
@billboard = Billboard.find(billboard_event_id)
|
||||
|
||||
num_impressions = @billboard.billboard_events.impressions.sum(:counts_for)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ module Articles
|
|||
def other_suggestions(max: MAX_DEFAULT, ids_to_ignore: [])
|
||||
ids_to_ignore << article.id
|
||||
Article.published
|
||||
.where("published_at > ?", 3.months.ago)
|
||||
.where.not(id: ids_to_ignore)
|
||||
.not_authored_by(article.user_id)
|
||||
.order(hotness_score: :desc)
|
||||
|
|
@ -48,6 +49,7 @@ module Articles
|
|||
def suggestions_by_tag(max: MAX_DEFAULT)
|
||||
Article
|
||||
.published
|
||||
.where("published_at > ?", 3.months.ago)
|
||||
.cached_tagged_with_any(cached_tag_list_array)
|
||||
.not_authored_by(article.user_id)
|
||||
.where(tag_suggestion_query)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue