Skip to content

Commit

Permalink
Error if invalidated node is deleted #56
Browse files Browse the repository at this point in the history
  • Loading branch information
rymsha committed May 14, 2024
1 parent f9336da commit d7fec96
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/com/enonic/app/booster/storage/NodeCleanerBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.enonic.xp.node.NodeHit;
import com.enonic.xp.node.NodeHits;
import com.enonic.xp.node.NodeId;
import com.enonic.xp.node.NodeNotFoundException;
import com.enonic.xp.node.NodeQuery;
import com.enonic.xp.node.NodeService;
import com.enonic.xp.node.RefreshMode;
Expand Down Expand Up @@ -196,8 +197,15 @@ private void process( final NodeQuery query, final Consumer<NodeId> op )

private void setInvalidatedTime( final NodeId nodeId, final Instant cutOffTime )
{
nodeService.update(
UpdateNodeParams.create().id( nodeId ).editor( editor -> editor.data.setInstant( "invalidatedTime", cutOffTime ) ).build() );
try
{
nodeService.update(
UpdateNodeParams.create().id( nodeId ).editor( editor -> editor.data.setInstant( "invalidatedTime", cutOffTime ) ).build() );
}
catch ( NodeNotFoundException e )
{
LOG.debug( "Node for invalidate was already deleted", e );
}
}

private void delete( final NodeId nodeId )
Expand Down

0 comments on commit d7fec96

Please sign in to comment.