Skip to content

Commit

Permalink
Clear the metadata cache when setting FORCE_CHECKSUM_AND_WRITE
Browse files Browse the repository at this point in the history
  • Loading branch information
sswguo committed Nov 20, 2024
1 parent 02dd94c commit d6b896d
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.io.InputStream;
import java.util.Collections;

import static org.commonjava.indy.core.content.ContentMetadataGenerator.FORCE_CHECKSUM_AND_WRITE;
import static org.commonjava.maven.galley.io.ChecksummingTransferDecorator.FORCE_CHECKSUM;

/**
Expand Down Expand Up @@ -127,11 +128,18 @@ public TransferMetadata digest( final StoreKey key, final String path, final Eve
return new TransferMetadata( Collections.emptyMap(), 0L );
}

TransferMetadata meta = getContentMetadata( transfer );
if ( meta != null )
if ( Boolean.parseBoolean( String.valueOf( eventMetadata.get( FORCE_CHECKSUM_AND_WRITE ) ) ) )
{
logger.debug( "Get transferMetadata: {}", meta );
return meta;
removeMetadata( transfer );
}
else
{
TransferMetadata meta = getContentMetadata( transfer );
if ( meta != null )
{
logger.debug( "Get transferMetadata: {}", meta );
return meta;
}
}

String cacheKey = generateCacheKey( transfer );
Expand Down

0 comments on commit d6b896d

Please sign in to comment.