mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
Merge pull request #8980 from toniprieto/index-consumer-readonly-mode
Improve performance of discovery consumer when there are many items to index
This commit is contained in:
@@ -205,6 +205,10 @@ public class IndexEventConsumer implements Consumer {
|
||||
@Override
|
||||
public void end(Context ctx) throws Exception {
|
||||
|
||||
// Change the mode to readonly to improve performance
|
||||
Context.Mode originalMode = ctx.getCurrentMode();
|
||||
ctx.setMode(Context.Mode.READ_ONLY);
|
||||
|
||||
try {
|
||||
for (String uid : uniqueIdsToDelete) {
|
||||
try {
|
||||
@@ -234,6 +238,8 @@ public class IndexEventConsumer implements Consumer {
|
||||
uniqueIdsToDelete.clear();
|
||||
createdItemsToUpdate.clear();
|
||||
}
|
||||
|
||||
ctx.setMode(originalMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user