QueueMemento : fix synchronized
This commit is contained in:
parent
629488bbe6
commit
b1f492de58
|
@ -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 New Issue