Skip to content

Commit 7c31cf3

Browse files
committed
fix(graphql-api): Fixed queues not starting sometimes
1 parent 7671ddc commit 7c31cf3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

apps/graphql-api/src/shared/torrent/torrent.service.ts

+8
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ export class TorrentService {
184184
this.downloads.push(download)
185185

186186
this.logger.log(`[${download._id}]: Added to queue, new size: ${this.downloads.length}`)
187+
188+
// If the new length is 1 and the flag is still true something went wrong so put it to false
189+
// and start downloads
190+
if (this.downloads.length === 1 && this.backgroundDownloading) {
191+
this.backgroundDownloading = false
192+
193+
this.startDownloads()
194+
}
187195
}
188196

189197
/**

0 commit comments

Comments
 (0)