Rate limit tracker requests during manga migration
This commit is contained in:
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|||||||
- (**Migration**) Show "abort" button during active bulk migration search
|
- (**Migration**) Show "abort" button during active bulk migration search
|
||||||
- (**Migration**) Keep the migration page open when aborting during the actual migration execution
|
- (**Migration**) Keep the migration page open when aborting during the actual migration execution
|
||||||
- (**Migration**) Prevent concurrent requests to the same tracker
|
- (**Migration**) Prevent concurrent requests to the same tracker
|
||||||
|
- (**Migration**) Allow only 2 tracker requests per second
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -300,13 +300,20 @@ export class MangaMigration {
|
|||||||
(trackRecord) =>
|
(trackRecord) =>
|
||||||
MangaMigration.getOrCreateQueue(trackRecord.trackerId).enqueue(
|
MangaMigration.getOrCreateQueue(trackRecord.trackerId).enqueue(
|
||||||
String(mangaToMigrate.id),
|
String(mangaToMigrate.id),
|
||||||
() =>
|
async () => {
|
||||||
requestManager.bindTracker(
|
try {
|
||||||
mangaToMigrateTo.id,
|
await requestManager.bindTracker(
|
||||||
trackRecord.trackerId,
|
mangaToMigrateTo.id,
|
||||||
trackRecord.remoteId,
|
trackRecord.trackerId,
|
||||||
trackRecord.private,
|
trackRecord.remoteId,
|
||||||
).response,
|
trackRecord.private,
|
||||||
|
).response;
|
||||||
|
} finally {
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
setTimeout(resolve, 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
).promise,
|
).promise,
|
||||||
),
|
),
|
||||||
cleanup: () =>
|
cleanup: () =>
|
||||||
|
|||||||
Reference in New Issue
Block a user