File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/edu/harvard/iq/dataverse/api Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ public Response updateCitationsForDataset(@PathParam("id") String id) throws IOE
160160 url = new URI (JvmSettings .DATACITE_REST_API_URL .lookup (pidProvider .getId ()) +
161161 "/events?doi=" +
162162 authorityPlusIdentifier +
163- "&source=crossref&page[size]=1000" ).toURL ();
163+ "&source=crossref&page[size]=1000&page[cursor]=1 " ).toURL ();
164164 } catch (URISyntaxException e ) {
165165 //Nominally this means a config error/ bad DATACITE_REST_API_URL for this provider
166166 logger .warning ("Unable to create URL for " + persistentId + ", pidProvider " + pidProvider .getId ());
@@ -175,11 +175,14 @@ public Response updateCitationsForDataset(@PathParam("id") String id) throws IOE
175175 int status = connection .getResponseCode ();
176176 if (status != 200 ) {
177177 logger .warning ("Failed to get citations from " + url .toString ());
178+ connection .disconnect ();
178179 return error (Status .fromStatusCode (status ), "Failed to get citations from " + url .toString ());
179180 }
180181 JsonObject report ;
181182 try (InputStream inStream = connection .getInputStream ()) {
182183 report = JsonUtil .getJsonObject (inStream );
184+ } finally {
185+ connection .disconnect ();
183186 }
184187 JsonObject links = report .getJsonObject ("links" );
185188 JsonArray data = report .getJsonArray ("data" );
You can’t perform that action at this time.
0 commit comments