olamy commented on code in PR #33:
URL:
https://github.com/apache/maven-build-cache-extension/pull/33#discussion_r1284171456
##########
src/main/java/org/apache/maven/buildcache/RemoteCacheRepositoryImpl.java:
##########
@@ -144,19 +145,32 @@ public void saveArtifactFile(CacheResult cacheResult,
org.apache.maven.artifact.
* @return null or content
*/
@Nonnull
- public Optional<byte[]> getResourceContent(String url) throws IOException {
+ public Optional<byte[]> getResourceContent(String url) {
+ String fullUrl = getFullUrl(url);
try {
- LOGGER.info("Downloading {}", getFullUrl(url));
+ LOGGER.info("Downloading {}", fullUrl);
GetTask task = new GetTask(new URI(url));
transporter.get(task);
return Optional.of(task.getDataBytes());
- } catch (Exception e) {
- LOGGER.info("Cannot download {}", getFullUrl(url), e);
+ } catch (ResourceDoesNotExistException e) {
+ if (LOGGER.isDebugEnabled()) {
+ LOGGER.debug("Cache item not found: {}", fullUrl, e);
Review Comment:
> Maybe? It's a tradeoff - you want to know how well the cache is working
but you don't want to clutter the log (in some of our builds we have nearly 100
modules). Also the "not found" phrase implies to me that something could be
wrong but of course a cache miss is completely normal, so perhaps "Item not in
cache" would sound more innocent. A summary at the end of how much the cache
was used instead would be very nice...
agree I'm using the cache for a build with 328 modules so the current log is
very very verbose when the cache not found :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]