code simplified
This commit is contained in:
parent
0d28d6279c
commit
b418b08d23
@ -116,17 +116,12 @@ public class JpaPsqlTimeseriesDao extends AbstractChunkedAggregationTimeseriesDa
|
|||||||
partitioningRepository.save(psqlPartition);
|
partitioningRepository.save(psqlPartition);
|
||||||
log.trace("Adding partition to Set: {}", psqlPartition);
|
log.trace("Adding partition to Set: {}", psqlPartition);
|
||||||
partitions.put(psqlPartition.getStart(), psqlPartition);
|
partitions.put(psqlPartition.getStart(), psqlPartition);
|
||||||
} catch (Exception e) {
|
} catch (DataIntegrityViolationException ex) {
|
||||||
log.trace("Error occurred during partition save:", e);
|
log.trace("Error occurred during partition save:", ex);
|
||||||
if (e instanceof DataIntegrityViolationException) {
|
if (ex.getCause() instanceof ConstraintViolationException) {
|
||||||
DataIntegrityViolationException ex = (DataIntegrityViolationException) e;
|
log.warn("Saving partition [{}] rejected. Timeseries data will save to the ts_kv_indefinite (DEFAULT) partition.", psqlPartition.getPartitionDate());
|
||||||
Throwable cause = ex.getCause();
|
|
||||||
if (cause instanceof ConstraintViolationException) {
|
|
||||||
ConstraintViolationException constraintViolationException = (ConstraintViolationException) cause;
|
|
||||||
log.warn("Saving partition [{}] rejected: {}", psqlPartition.getPartitionDate(), constraintViolationException.getCause().getMessage());
|
|
||||||
partitions.put(psqlPartition.getStart(), psqlPartition);
|
partitions.put(psqlPartition.getStart(), psqlPartition);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
partitionCreationLock.unlock();
|
partitionCreationLock.unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user