Add synchronization

This commit is contained in:
Alex Sytnyk 2018-08-13 18:40:40 +03:00
parent b41a2560a8
commit 0ec2fb2895

View file

@ -36,7 +36,9 @@ class MessagesDbHelper(val app: TelegramApplication) {
fun saveMessages() { fun saveMessages() {
sqliteHelper.clearMessages() sqliteHelper.clearMessages()
sqliteHelper.addMessages(messages) synchronized(messages) {
sqliteHelper.addMessages(messages)
}
} }
private fun addMessage(chatId: Long, messageId: Long) { private fun addMessage(chatId: Long, messageId: Long) {