mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 18:26:57 +00:00
Fix bug related to in-memory jobs not being prioritized properly.
This commit is contained in:
committed by
jeffrey-signal
parent
9ed921f58c
commit
c25ce2bcdd
@@ -356,10 +356,15 @@ class FastJobStorage(private val jobDatabase: JobDatabase) : JobStorage {
|
||||
mostEligibleJobForQueue.keys.removeAll(affectedQueues)
|
||||
|
||||
for (queue in affectedQueues) {
|
||||
jobDatabase.getMostEligibleJobInQueue(queue)?.let {
|
||||
jobSpecCache[it.id] = it
|
||||
placeJobInEligibleList(it.toMinimalJobSpec())
|
||||
}
|
||||
minimalJobs
|
||||
.filter { it.queueKey == queue }
|
||||
.minWithOrNull(
|
||||
compareByDescending<MinimalJobSpec> { it.globalPriority }
|
||||
.thenByDescending { it.queuePriority }
|
||||
.thenBy { it.createTime }
|
||||
.thenBy { it.id }
|
||||
)
|
||||
?.let { placeJobInEligibleList(it) }
|
||||
}
|
||||
|
||||
for (jobId in ids) {
|
||||
|
||||
Reference in New Issue
Block a user