Fix bulk migration with migrating entries to their current source

When migrating an entry to the same source as it already is from, the source queues got blocked, preventing any progress.

Since the migration does not do any request to the source of the entry to migrate, it is not required to go through the queue for the source.
This commit is contained in:
schroda
2026-05-08 01:50:24 +02:00
parent d1e70c2609
commit f7801de750

View File

@@ -875,20 +875,18 @@ export class MigrationManager {
return; return;
} }
await MigrationManager.getParallelSourceQueue()(() => await MigrationManager.getParallelSourceQueue()(() => {
MigrationManager.getOrCreateSourceQueue(entry.sourceId)(() => { assertIsDefined(entry.selectedMatchSourceId);
assertIsDefined(entry.selectedMatchSourceId);
return MigrationManager.getOrCreateSourceQueue(entry.selectedMatchSourceId)(async () => { return MigrationManager.getOrCreateSourceQueue(entry.selectedMatchSourceId)(async () => {
if (signal.aborted) { if (signal.aborted) {
return; return;
} }
assertIsDefined(entry.selectedMatchMangaId); assertIsDefined(entry.selectedMatchMangaId);
await MangaMigration.migrate(mangaId, entry.selectedMatchMangaId, options); await MangaMigration.migrate(mangaId, entry.selectedMatchMangaId, options);
}); });
}), });
);
MigrationManager.updateState((draft) => { MigrationManager.updateState((draft) => {
draft.entries[mangaId].status = MigrationEntryStatus.MIGRATION_COMPLETE; draft.entries[mangaId].status = MigrationEntryStatus.MIGRATION_COMPLETE;