Yet another timestamp format variant added to the Scan Queue processings.
@@ -166,6 +166,7 @@ public class CxService {
HttpEntity requestEntity = new HttpEntity<>(createAuthHeaders());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS");
DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SS");
+ DateTimeFormatter formatter3 = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
log.info("Finding last Scan Id for project Id {}", projectId);
try {
@@ -192,11 +193,16 @@ public class CxService {
log.info("Attempting 2nd format 'yyyy-MM-dd'T'HH:mm:ss.SS'");
d = LocalDateTime.parse(dateAndTime.getString("finishedOn"), formatter2);
}catch (DateTimeParseException e2){
+ log.info("Attempting 3rd format 'yyyy-MM-dd'T'HH:mm:ss'");
+ try {
+ d = LocalDateTime.parse(dateAndTime.getString("finishedOn"), formatter3);
+ }catch (DateTimeParseException e3){
log.error(ExceptionUtils.getStackTrace(e2));
log.error(e2.getParsedString());
return null;
}
}
+ }
return d;
}
}
