[develop | DONE | FIXED] bulk upload dois - fetch from crossref: introduce a delay to avoid 429 response from API
This commit is contained in:
parent
3ea0ee3d1e
commit
9c8ac92c91
|
@ -150,7 +150,7 @@ export class BulkClaimComponent {
|
||||||
}
|
}
|
||||||
this.loading.open();
|
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.
|
const rows = (result as any).split('\n'); // I have used space, you can use any thing.
|
||||||
this.exceedsLimit = false;
|
this.exceedsLimit = false;
|
||||||
let invalid_rows = 0;
|
let invalid_rows = 0;
|
||||||
|
@ -179,6 +179,7 @@ export class BulkClaimComponent {
|
||||||
this.allIds.push(id);
|
this.allIds.push(id);
|
||||||
if (currentLength < this.basketLimit){
|
if (currentLength < this.basketLimit){
|
||||||
currentLength++;
|
currentLength++;
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||||
this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1);
|
this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1);
|
||||||
}else{
|
}else{
|
||||||
this.exceedsLimit = true;
|
this.exceedsLimit = true;
|
||||||
|
|
Loading…
Reference in New Issue