Commit 50b5e327 authored by Matija Obreza's avatar Matija Obreza

Reduced logging

parent 65a80967
......@@ -81,6 +81,7 @@ import org.genesys2.util.JPAUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
......@@ -1167,7 +1168,11 @@ public class DatasetServiceImpl implements DatasetService {
Lists.partition(accessionRefs, 10000).parallelStream().forEach((batch) -> {
threadPoolTaskExecutor.execute(() -> {
LOG.info("Rematching {} subset refs", batch.size());
accessionRefMatcher.rematchAccessionRefs(batch, accessionRefRepository);
try {
accessionRefMatcher.rematchAccessionRefs(batch, accessionRefRepository);
} catch (DataIntegrityViolationException e) {
LOG.info("Rematch failed with {}", e.getMessage());
}
});
});
}
......
......@@ -182,7 +182,7 @@ public class ApiExceptionHandler {
@ExceptionHandler({ InvalidApiUsageException.class, DataIntegrityViolationException.class, ConcurrencyFailureException.class, FileRepositoryException.class, NotUniqueUserException.class })
@ResponseBody
public ApiError<Exception> handleInvalidApiUsage(final Exception e, final HttpServletRequest request) {
LOG.warn("{} for {} {}", e.getMessage(), request.getMethod(), request.getRequestURL(), e);
LOG.warn("{} for {} {}", e.getMessage(), request.getMethod(), request.getRequestURL());
return new ApiError<>(e);
}
......
......@@ -66,6 +66,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
......@@ -668,7 +669,11 @@ public class SubsetServiceImpl implements SubsetService {
Lists.partition(accessionRefs, 10000).parallelStream().forEach((batch) -> {
threadPoolTaskExecutor.execute(() -> {
LOG.info("Rematching {} subset refs", batch.size());
accessionRefMatcher.rematchAccessionRefs(batch, accessionRefRepository);
try {
accessionRefMatcher.rematchAccessionRefs(batch, accessionRefRepository);
} catch (DataIntegrityViolationException e) {
LOG.info("Rematch failed with {}", e.getMessage());
}
});
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment