Skip to content

Commit

Permalink
Merge pull request DSpace#9069 from tdonohue/fix_cannot_index_site
Browse files Browse the repository at this point in the history
Fix "Site cannot be indexed" error which appears in ITs and sometimes in logs
  • Loading branch information
tdonohue authored Oct 27, 2023
2 parents 09d25a9 + ef7f02f commit 1c86d00
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ public void consume(Context ctx, Event event) throws Exception {

case Event.REMOVE:
case Event.ADD:
if (object == null) {
// At this time, ADD and REMOVE actions are ignored on SITE object. They are only triggered for
// top-level communities. No action is necessary as Community itself is indexed (or deleted) separately.
if (event.getSubjectType() == Constants.SITE) {
log.debug(event.getEventTypeAsString() + " event triggered for Site object. Skipping it.");
} else if (object == null) {
log.warn(event.getEventTypeAsString() + " event, could not get object for "
+ event.getObjectTypeAsString() + " id="
+ event.getObjectID()
Expand Down

0 comments on commit 1c86d00

Please sign in to comment.