CleanupExpiredArtifactsFromProxyRepositoriesCronJobTestIT fixed
@@ -158,15 +158,6 @@ public abstract class AbstractRepositoryProvider extends RepositoryStreamSupport
{
RepositoryPath repositoryPath = (RepositoryPath) ctx.getPath();
logger.debug(String.format("Closing [%s]", repositoryPath));
-
- ArtifactEntry artifactEntry = repositoryPath.artifactEntry;
- if (artifactEntry == null)
- {
- return;
- }
-
- CountingOutputStream cos = StreamUtils.findSource(CountingOutputStream.class, ctx.getStream());
- artifactEntry.setSizeInBytes(cos.getByteCount());
}
@Override
@@ -204,12 +195,14 @@ public abstract class AbstractRepositoryProvider extends RepositoryStreamSupport
ArtifactEntry artifactEntry = repositoryPath.artifactEntry;
repositoryPath.artifactEntry = null;
-
if (artifactEntry == null)
{
return;
}
+ CountingOutputStream cos = StreamUtils.findSource(CountingOutputStream.class, ctx.getStream());
+ artifactEntry.setSizeInBytes(cos.getByteCount());
+
artifactEntryService.save(artifactEntry, true);
}
