mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[DS-1848] OAI harvest issues when starting from control panel/command line
This commit is contained in:
@@ -374,8 +374,12 @@ public class OAIHarvester {
|
|||||||
listRecords = new ListRecords(oaiSource, resumptionToken);
|
listRecords = new ListRecords(oaiSource, resumptionToken);
|
||||||
}
|
}
|
||||||
ourContext.turnOffAuthorisationSystem();
|
ourContext.turnOffAuthorisationSystem();
|
||||||
targetCollection.update();
|
try {
|
||||||
ourContext.restoreAuthSystemState();
|
targetCollection.update();
|
||||||
|
} finally {
|
||||||
|
//In case of an exception, make sure to restore our authentication state to the previous state
|
||||||
|
ourContext.restoreAuthSystemState();
|
||||||
|
}
|
||||||
ourContext.commit();
|
ourContext.commit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -404,7 +408,6 @@ public class OAIHarvester {
|
|||||||
targetCollection.update();
|
targetCollection.update();
|
||||||
ourContext.commit();
|
ourContext.commit();
|
||||||
ourContext.restoreAuthSystemState();
|
ourContext.restoreAuthSystemState();
|
||||||
ourContext.restoreAuthSystemState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we got to this point, it means the harvest was completely successful
|
// If we got to this point, it means the harvest was completely successful
|
||||||
|
Reference in New Issue
Block a user