Commit 0d54d67f authored by Bergamote Orange's avatar Bergamote Orange
Browse files

MR comments

parent f9a41097
......@@ -137,7 +137,7 @@ public class ReportService implements IReportService {
private long validatePivotDate(long pivotDate, Instant now) {
Instant pivotDateAsInstant = TimeUtils.instantFromTimestamp(pivotDate);
Instant nowWithoutMilis = now.truncatedTo(ChronoUnit.SECONDS);
Instant retentionDateLimit = now.minus(retentionDurationInDays, ChronoUnit.DAYS);
Instant retentionDateLimit = nowWithoutMilis.minus(retentionDurationInDays, ChronoUnit.DAYS);
if (pivotDateAsInstant.isAfter(now) || pivotDateAsInstant.isBefore(retentionDateLimit)) {
long retentionDateLimitAsNtp = TimeUtils.ntpTimestampFromInstant(retentionDateLimit);
log.warn("pivotDate: {} not between retentionLimitDate: {} and now: {}", pivotDateAsInstant, retentionDateLimit, now);
......
......@@ -17,7 +17,12 @@ import fr.inria.clea.lsp.exception.CleaEncodingException;
import fr.inria.clea.lsp.utils.TimeUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.tomcat.util.codec.binary.Base64;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.DisplayNameGenerator;
import org.slf4j.LoggerFactory;
import java.time.Instant;
......
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