updated concurrency

This commit is contained in:
Nihaal Sharma committed 2026-05-01 23:57:41 +01:00
1 parent aa9d2b72c3
commit 7a40a84e82
1 file changed
+20 -5
+20 -5
View File
@@ -197,10 +197,18 @@ class EmojiHoarder: BaseHoarder {
}
nonisolated func batchDownload(emojis emojisToDownload: [any StickerProtocol]) async {
for emoji in emojisToDownload {
await download(emoji: emoji, skipStoreIndex: true)
await withTaskGroup { group in
for emoji in emojisToDownload {
group.addTask {
await self.download(emoji: emoji, skipStoreIndex: true)
await MainActor.run {
// Task { @MainActor in
self.downloadedStickers.insert(emoji.name)
self.downloadedStickersArr.append(emoji.name)
}
}
}
}
await buildDownloadedStickers()
}
@@ -219,9 +227,16 @@ class EmojiHoarder: BaseHoarder {
}
nonisolated func batchDelete(emojis emojisToDelete: [any StickerProtocol]) async {
for emoji in emojisToDelete {
await delete(emoji: emoji, skipStoreIndex: true)
await withTaskGroup { group in
for emoji in emojisToDelete {
group.addTask {
await self.delete(emoji: emoji, skipStoreIndex: true)
}
}
}
// for emoji in emojisToDelete {
// await delete(emoji: emoji, skipStoreIndex: true)
// }
await buildDownloadedStickers()
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.