use of org.commonjava.indy.db.common.AbstractStoreDataManager in project indy by Commonjava.
the class KojiMavenMetadataProvider method handleExpired.
private void handleExpired(ProjectRef key) {
Logger logger = LoggerFactory.getLogger(getClass());
if (!kojiConfig.isEnabled()) {
logger.debug("Koji add-on is disabled.");
return;
}
logger.info("Koji metadata expired for GA: {}", key);
try {
Set<Group> affected = storeDataManager.query().getAll(s -> group == s.getType() && kojiConfig.isEnabledFor(s)).stream().map(s -> (Group) s).collect(Collectors.toSet());
if (storeDataManager instanceof AbstractStoreDataManager) {
affected = ((AbstractStoreDataManager) storeDataManager).filterAffectedGroups(affected);
}
if (!affected.isEmpty()) {
logger.info("Triggering metadata cleanup from Koji metadata expiration, for GA: {} in groups: {}", key, affected);
String path = ArtifactPathUtils.formatMetadataPath(key, METADATA_NAME);
clearPaths(affected, path);
}
} catch (IndyDataException ex) {
logger.error("Failed to clear group metadata for expired Koji metadata: " + key, ex);
} catch (TransferException ex) {
logger.error("Failed to format metadata path for: " + key, ex);
}
}
Aggregations