Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update logs for testing #261

Merged
merged 1 commit into from
May 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -624,20 +624,20 @@ class DiffJsonOutput{
@PostGsrsRestApiMapping(value = "/@databaseIndexSync", apiVersions = 1)
public ResponseEntity<Object> syncIndexesWithDatabase() throws JsonMappingException, JsonProcessingException{

log.info("in syncIndexesWithDatabase");
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.info("Database and index sync: No different items.");
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.info("Database and index sync: found " + list.size() + " different items.");
log.error("in syncIndexesWithDatabase: Database and index sync: found " + list.size() + " different items.");
return new ResponseEntity<>(bulkReindexListOfIDs(list, false), HttpStatus.OK);
}
}
Expand Down