fix sync expiries jobs

pull/941/head
Ryan Zhao 2 years ago
parent 3368f184de
commit 4cc6d24404

@ -27,7 +27,10 @@ public enum SyncExpiriesJob: JobExecutor {
return
}
guard DisappearingMessagesConfiguration.isNewConfigurationEnabled else { return }
guard DisappearingMessagesConfiguration.isNewConfigurationEnabled else {
success(job, false)
return
}
var interactionIdsWithNoServerHashByExpiresInSeconds: [TimeInterval: [Int64]] = [:]
@ -76,8 +79,7 @@ public enum SyncExpiriesJob: JobExecutor {
).retainUntilComplete()
}
guard !interactionIdsWithNoServerHashByExpiresInSeconds.isEmpty else { return }
if !interactionIdsWithNoServerHashByExpiresInSeconds.isEmpty {
Storage.shared.writeAsync { db in
JobRunner.upsert(
db,
@ -92,6 +94,9 @@ public enum SyncExpiriesJob: JobExecutor {
)
}
}
success(job, false)
}
}
// MARK: - SyncExpiriesJob.Details

@ -91,6 +91,7 @@ public final class JobRunner {
)
let syncExpiriesQueue: JobQueue = JobQueue(
type: .syncExpiries,
executionType: .concurrent, // Allow as many jobs to run at once as supported by the device
qos: .default,
jobVariants: [
jobVariants.remove(.syncExpires)

Loading…
Cancel
Save