mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 18:35:40 +03:00
QueueMemento : fix synchronized
This commit is contained in:
parent
629488bbe6
commit
b1f492de58
1 changed files with 16 additions and 16 deletions
|
@ -49,9 +49,11 @@ internal class QueueMemento @Inject constructor(context: Context,
|
|||
}
|
||||
|
||||
fun unTrack(task: QueuedTask) {
|
||||
synchronized(managedTaskInfos) {
|
||||
managedTaskInfos.remove(task)
|
||||
persist()
|
||||
}
|
||||
}
|
||||
|
||||
private fun persist() {
|
||||
managedTaskInfos.mapIndexedNotNull { index, queuedTask ->
|
||||
|
@ -64,7 +66,6 @@ internal class QueueMemento @Inject constructor(context: Context,
|
|||
}
|
||||
|
||||
private fun toTaskInfo(task: QueuedTask, order: Int): TaskInfo? {
|
||||
synchronized(managedTaskInfos) {
|
||||
return when (task) {
|
||||
is SendEventQueuedTask -> SendEventTaskInfo(
|
||||
localEchoId = task.event.eventId ?: "",
|
||||
|
@ -78,7 +79,6 @@ internal class QueueMemento @Inject constructor(context: Context,
|
|||
else -> null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun restoreTasks(eventProcessor: EventSenderProcessor) {
|
||||
// events should be restarted in correct order
|
||||
|
|
Loading…
Reference in a new issue