diff --git a/CHANGELOG.md b/CHANGELOG.md index ed909851..63ee6b21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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**) Keep the migration page open when aborting during the actual migration execution - (**Migration**) Prevent concurrent requests to the same tracker +- (**Migration**) Allow only 2 tracker requests per second ### Fixed diff --git a/src/features/migration/MangaMigration.ts b/src/features/migration/MangaMigration.ts index 4a2ce229..2b2bfdf9 100644 --- a/src/features/migration/MangaMigration.ts +++ b/src/features/migration/MangaMigration.ts @@ -300,13 +300,20 @@ export class MangaMigration { (trackRecord) => MangaMigration.getOrCreateQueue(trackRecord.trackerId).enqueue( String(mangaToMigrate.id), - () => - requestManager.bindTracker( - mangaToMigrateTo.id, - trackRecord.trackerId, - trackRecord.remoteId, - trackRecord.private, - ).response, + async () => { + try { + await requestManager.bindTracker( + mangaToMigrateTo.id, + trackRecord.trackerId, + trackRecord.remoteId, + trackRecord.private, + ).response; + } finally { + await new Promise((resolve) => { + setTimeout(resolve, 500); + }); + } + }, ).promise, ), cleanup: () =>