Skip to content

Commit

Permalink
Fix "Site cannot be indexed" error by ignoring ADD/REMOVE events on S…
Browse files Browse the repository at this point in the history
…ite object
  • Loading branch information
tdonohue committed Sep 13, 2023
1 parent b6d20ee commit ef7f02f
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 ef7f02f

Please sign in to comment.