Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Dec 4, 2024
1 parent f28c39f commit 7055934
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ GEM
unicode (0.4.4.5)
unicode-display_width (2.6.0)
uri (1.0.2)
uri-query_params (0.8.2)
useragent (0.16.10)
valid_email2 (7.0.0)
activemodel (>= 6.0)
Expand Down Expand Up @@ -860,6 +861,7 @@ DEPENDENCIES
slim_lint
solargraph
tzinfo-data
uri-query_params
valid_email2
validate_url
vcr
Expand Down
4 changes: 2 additions & 2 deletions app/jobs/alert_email/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def perform
# really fast (1 week's worth of vacancies is around 2000, so not worth leaving on disk for each of 100k daily subscriptions
default_scope = Vacancy.includes(:organisations).live.order(publish_on: :desc).search_by_filter(from_date: from_date, to_date: Date.current)

already_run_ids = AlertRun.for_today.map(&:subscription_id)
already_run_ids = AlertRun.for_today.pluck(:subscription_id)

subscriptions.find_each.reject { |sub| already_run_ids.include?(sub.id) }.each do |subscription|
vacancies = subscription.vacancies_matching default_scope
vacancies = subscription.vacancies_matching(default_scope).first(MAXIMUM_RESULTS_PER_RUN)

Jobseekers::AlertMailer.alert(subscription.id, vacancies.pluck(:id)).deliver_later if vacancies.any?
end
Expand Down

0 comments on commit 7055934

Please sign in to comment.