mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 11:23:48 +00:00
Fix fetch queue parallelization
This commit is contained in:
parent
96a410fc14
commit
2e71c1fa5e
@ -748,7 +748,9 @@ public final class AnimationCacheImpl: AnimationCache {
|
||||
updateResult(AnimationCacheItemResult(item: nil, isFinal: false))
|
||||
|
||||
if beginFetch {
|
||||
guard let writer = AnimationCacheItemWriterImpl(queue: self.fetchQueues[self.nextFetchQueueIndex % self.fetchQueues.count], allocateTempFile: self.allocateTempFile, completion: { [weak self, weak itemContext] result in
|
||||
let fetchQueueIndex = self.nextFetchQueueIndex
|
||||
self.nextFetchQueueIndex += 1
|
||||
guard let writer = AnimationCacheItemWriterImpl(queue: self.fetchQueues[fetchQueueIndex % self.fetchQueues.count], allocateTempFile: self.allocateTempFile, completion: { [weak self, weak itemContext] result in
|
||||
queue.async {
|
||||
guard let strongSelf = self, let itemContext = itemContext, itemContext === strongSelf.itemContexts[sourceId] else {
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user