Browse Source

- Reduce the "PublicationsRetriever.threadsMultiplier" to 4.

- Eliminate a possible NPE.
master
Lampros Smyrnaios 5 months ago
parent
commit
a8e2ddcf54
  1. 4
      src/main/java/eu/openaire/urls_worker/plugins/PublicationsRetrieverPlugin.java

4
src/main/java/eu/openaire/urls_worker/plugins/PublicationsRetrieverPlugin.java

@ -52,7 +52,7 @@ public class PublicationsRetrieverPlugin {
ConnSupportUtils.shouldBlockMost5XXDomains = false;
LoaderAndChecker.setCouldRetryRegex();
PublicationsRetriever.threadsMultiplier = 6;
PublicationsRetriever.threadsMultiplier = 4;
int workerThreadsCount = Runtime.getRuntime().availableProcessors() * PublicationsRetriever.threadsMultiplier;
logger.info("Use " + workerThreadsCount + " worker-threads.");
PublicationsRetriever.executor = Executors.newFixedThreadPool(workerThreadsCount);
@ -157,7 +157,7 @@ public class PublicationsRetrieverPlugin {
//logger.debug("initialId: " + initialId); // DEBUG!
// Search that ID inside the list and if that instance gave the docUrl (there might be multiple ID instances) then get the file-location.
for ( DataToBeLogged data_2 : FileUtils.dataToBeLoggedList ) {
if ( data_2.getUrlId().equals(initialId) && data_2.getWasDocumentOrDatasetAccessible().equals("true") ) {
if ( data_2.getUrlId().equals(initialId) && ("true".equals(data_2.getWasDocumentOrDatasetAccessible())) ) {
fileLocation = data_2.getComment();
size = data_2.getSize();
hash = data_2.getHash();

Loading…
Cancel
Save