[develop | DONE | FIXED] bulk upload dois - fetch from crossref: introduce a delay to avoid 429 response from API

This commit is contained in:
argirok 2024-09-19 14:26:58 +03:00
parent 3ea0ee3d1e
commit 9c8ac92c91
1 changed files with 2 additions and 1 deletions

View File

@ -150,7 +150,7 @@ export class BulkClaimComponent {
}
this.loading.open();
this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then((result) => {
this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then(async (result) => {
const rows = (result as any).split('\n'); // I have used space, you can use any thing.
this.exceedsLimit = false;
let invalid_rows = 0;
@ -179,6 +179,7 @@ export class BulkClaimComponent {
this.allIds.push(id);
if (currentLength < this.basketLimit){
currentLength++;
await new Promise((resolve) => setTimeout(resolve, 100));
this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1);
}else{
this.exceedsLimit = true;