100302: Fix issue with Pubmed too many requests

This commit is contained in:
Yana De Pauw
2023-03-27 16:44:07 +02:00
parent 4cdb66267e
commit 56aca5c14f
3 changed files with 8 additions and 3 deletions

View File

@@ -501,4 +501,4 @@ public class PubmedImportMetadataSourceServiceImpl extends AbstractImportMetadat
this.urlSearch = urlSearch; this.urlSearch = urlSearch;
} }
} }

View File

@@ -183,6 +183,7 @@ public abstract class AbstractRemoteMetadataSource {
log.warn("Error in trying operation " + operationId + " " + retry + " " + warning + ", retrying !", e); log.warn("Error in trying operation " + operationId + " " + retry + " " + warning + ", retrying !", e);
} finally { } finally {
this.lastRequest = System.currentTimeMillis();
lock.unlock(); lock.unlock();
} }
@@ -262,5 +263,7 @@ public abstract class AbstractRemoteMetadataSource {
*/ */
public abstract void init() throws Exception; public abstract void init() throws Exception;
public void setInterRequestTime(final long interRequestTime) {
this.interRequestTime = interRequestTime;
}
} }

View File

@@ -49,6 +49,8 @@
<property name="urlFetch" value="${pubmed.url.fetch}"/> <property name="urlFetch" value="${pubmed.url.fetch}"/>
<property name="urlSearch" value="${pubmed.url.search}"/> <property name="urlSearch" value="${pubmed.url.search}"/>
<property name="generateQueryForItem" ref="pubmedService"></property> <property name="generateQueryForItem" ref="pubmedService"></property>
<property name="interRequestTime" value="500"/>
<property name="maxRetry" value="2"/>
<property name="supportedExtensions"> <property name="supportedExtensions">
<list> <list>
<value>xml</value> <value>xml</value>
@@ -191,4 +193,4 @@
<constructor-arg value="dc.identifier.other"/> <constructor-arg value="dc.identifier.other"/>
</bean> </bean>
</beans> </beans>