Skip to content

Commit

Permalink
skip ActiveFedora indexing if Wings is disabled
Browse files Browse the repository at this point in the history
this whole module requires type checking on Wings, so just don't include it if
Wings is disabled.
  • Loading branch information
tamsin johnson committed Oct 22, 2021
1 parent 1fa578b commit 1dd5fda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ActiveFedoraAclIndexListener
#
# @param event [Dry::Event]
def on_object_acl_updated(event)
return if Hyrax.config.disable_wings
return unless event[:result] == :success # do nothing on failure

if Hyrax.metadata_adapter.is_a?(Wings::Valkyrie::MetadataAdapter)
Expand Down
3 changes: 2 additions & 1 deletion config/initializers/listeners.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# frozen_string_literal: true

Hyrax.publisher.subscribe(Hyrax::Listeners::AclIndexListener.new)
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraAclIndexListener.new)
Hyrax.publisher.subscribe(Hyrax::Listeners::ActiveFedoraAclIndexListener.new) unless
Hyrax.config.disable_wings
Hyrax.publisher.subscribe(Hyrax::Listeners::MemberCleanupListener.new)
Hyrax.publisher.subscribe(Hyrax::Listeners::MetadataIndexListener.new)
Hyrax.publisher.subscribe(Hyrax::Listeners::BatchNotificationListener.new)
Expand Down

0 comments on commit 1dd5fda

Please sign in to comment.