Skip to content

Commit

Permalink
remove testing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
blueSwordfish committed Jun 12, 2024
1 parent 922b725 commit eb9baf0
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -625,21 +625,17 @@ class DiffJsonOutput{

@PostGsrsRestApiMapping(value = "/@databaseIndexSync", apiVersions = 1)
public ResponseEntity<Object> syncIndexesWithDatabase() throws JsonMappingException, JsonProcessingException{

log.error("in syncIndexesWithDatabase");


List<Key> keysInDatabase = getKeys();
List<Key> keysInIndex = searchEntityInIndex();

Set<Key> extraInDatabase = Sets.difference(new HashSet<Key>(keysInDatabase), new HashSet<Key>(keysInIndex));
if(extraInDatabase.isEmpty()) {
log.error("in syncIndexesWithDatabase: Database and index sync: No different items.");
ObjectNode resultNode = JsonNodeFactory.instance.objectNode();
resultNode.put("message", "The entity index is in sync with the database. No reindexing needed.");
return new ResponseEntity<>(resultNode, HttpStatus.OK);
}else {
List<String> list = extraInDatabase.stream().map(format->format.getIdString()).collect(Collectors.toList());
log.error("in syncIndexesWithDatabase: Database and index sync: found " + list.size() + " different items.");
return new ResponseEntity<>(bulkReindexListOfIDs(list, false), HttpStatus.OK);
}
}
Expand Down

0 comments on commit eb9baf0

Please sign in to comment.