Do KeyOperations on the global thread.

pull/14/head
Mikunj 6 years ago committed by Mikunj Varsani
parent 8fff98d94e
commit 141fa8e2cc

@ -36,6 +36,8 @@ public class RefreshPreKeysOperation: OWSOperation {
return
}
// Loki: Doing this on the global queue because they do it at the bottom
DispatchQueue.global().async {
guard self.primaryStorage.currentSignedPrekeyId() == nil else {
Logger.debug("Already have a signed prekey set")
self.reportSuccess()
@ -52,6 +54,7 @@ public class RefreshPreKeysOperation: OWSOperation {
Logger.debug("done")
self.reportSuccess()
}
/* Loki: Original Code
* =============

@ -27,6 +27,8 @@ public class RotateSignedPreKeyOperation: OWSOperation {
return
}
// Loki: Doing this on the global queue because they do it at the bottom
DispatchQueue.global().async {
let signedPreKeyRecord = self.primaryStorage.generateRandomSignedRecord()
signedPreKeyRecord.markAsAcceptedByService()
self.primaryStorage.storeSignedPreKey(signedPreKeyRecord.id, signedPreKeyRecord: signedPreKeyRecord)
@ -37,6 +39,7 @@ public class RotateSignedPreKeyOperation: OWSOperation {
Logger.debug("done")
self.reportSuccess()
}
/* Loki: Original Code
* =========

Loading…
Cancel
Save