Insert only the records with uploaded-to-S3 full-texts, in the "payload" table.

This commit is contained in:
Lampros Smyrnaios 2022-02-17 16:27:40 +02:00
parent 71f6b46130
commit dfd40cb105
1 changed files with 5 additions and 1 deletions

View File

@ -279,11 +279,15 @@ public class UrlController {
continue;
}
String fileLocation = payload.getLocation();
if ( fileLocation == null ) // We want only the records with uploaded full-texts in the "payload" table.
continue;
try {
Long size = payload.getSize();
Object[] args = new Object[] {payload.getId(), payload.getOriginal_url(), payload.getActual_url(), payload.getTimestamp_acquired(),
payload.getMime_type(), (size != null) ? String.valueOf(size) : null, payload.getHash(),
payload.getLocation(), payload.getProvenance()};
fileLocation, payload.getProvenance()};
jdbcTemplate.update(insertIntoPayloadBaseQuery, args, payloadArgTypes);
} catch (Exception e) {