Skip to content

Commit 8753035

Browse files
Put AvatarHistoryManager.cleanupOrphanedImages off main thread
1 parent e8f1b75 commit 8753035

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Signal/AppLaunch/AppEnvironment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public class AppEnvironment: NSObject {
179179
}
180180

181181
Task {
182-
self.avatarHistoryManager.cleanupOrphanedImages()
182+
await self.avatarHistoryManager.cleanupOrphanedImages()
183183
}
184184

185185
Task {

Signal/Avatars/AvatarHistoryManager.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ class AvatarHistoryManager {
4242
)
4343
}
4444

45-
func cleanupOrphanedImages() {
46-
owsAssertDebug(!Thread.isMainThread)
47-
45+
func cleanupOrphanedImages() async {
4846
guard OWSFileSystem.fileOrFolderExists(url: imageHistoryDirectory) else { return }
4947

5048
let allRecords: [[AvatarRecord]] = db.read { tx in

0 commit comments

Comments
 (0)