Skip to content

Commit

Permalink
Merge branch '8009-limit-notify-cache-jobs' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Nov 14, 2023
2 parents e82c426 + ba7840b commit ba0de91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/models/info_request_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class InfoRequestEvent < ApplicationRecord
self.event_type = "hide"
end
after_create :update_request, if: :response?
after_create :invalidate_cached_pages
after_create :invalidate_cached_pages, unless: :no_xapian_reindex

after_commit -> { info_request.create_or_update_request_summary },
on: [:create]
Expand Down
3 changes: 2 additions & 1 deletion app/models/public_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ def self.admin_title

after_save :update_missing_email_tag

after_update :reindex_requested_from, :invalidate_cached_pages
after_update :reindex_requested_from, :invalidate_cached_pages,
unless: :no_xapian_reindex

# Every public body except for the internal admin one is visible
scope :visible, -> { where("public_bodies.id <> #{ PublicBody.internal_admin_body.id }") }
Expand Down
8 changes: 4 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ class User < ApplicationRecord
validate :email_and_name_are_valid

after_initialize :set_defaults
after_update :reindex_referencing_models,
:update_pro_account,
:invalidate_cached_pages

after_update :update_pro_account
after_update :reindex_referencing_models, :invalidate_cached_pages,
unless: :no_xapian_reindex

acts_as_xapian texts: [:name, :about_me],
values: [
Expand Down Expand Up @@ -330,7 +331,6 @@ def variety

# requested_by: and commented_by: search queries also need updating after save
def reindex_referencing_models
return if no_xapian_reindex == true
return unless saved_change_to_attribute?(:url_name)

expire_comments
Expand Down
2 changes: 2 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Highlighted Features

* Improve background job performance by limiting the number `NotifyCacheJob`
jobs created (Graeme Porteous)
* Signpost key user administration contributions for requests on request list
pages (Gareth Rees)
* Signpost users to find new contact details for requests with delivery errors
Expand Down

0 comments on commit ba0de91

Please sign in to comment.