Add synchronization
This commit is contained in:
parent
b41a2560a8
commit
0ec2fb2895
1 changed files with 3 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue