Skip to content

Commit 485caed

Browse files
authored
run trie generation thread with QOS set to background (#3502)
motivation: build the trie should not interrupt other threads changes: set QOS of trie thread to background
1 parent 6fb5138 commit 485caed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PackageCollections/Storage/SQLitePackageCollectionsStorage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ final class SQLitePackageCollectionsStorage: PackageCollectionsStorage, Closable
760760
}
761761

762762
internal func populateTargetTrie(callback: @escaping (Result<Void, Error>) -> Void = { _ in }) {
763-
DispatchQueue.sharedConcurrent.async {
763+
DispatchQueue.sharedConcurrent.async(group: nil, qos: .background, flags: .assignCurrentContext, execute: {
764764
self.targetTrieReady.memoize {
765765
do {
766766
// Use FTS to build the trie
@@ -794,7 +794,7 @@ final class SQLitePackageCollectionsStorage: PackageCollectionsStorage, Closable
794794
return false
795795
}
796796
}
797-
}
797+
})
798798
}
799799

800800
// for testing

0 commit comments

Comments
 (0)