Fix deadlock on checking pending notification

This commit is contained in:
Roman Volosovskyi 2022-02-23 12:09:46 +01:00
parent 89370b7d7f
commit b559c561d8
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
2 changed files with 9 additions and 2 deletions

View File

@ -1 +1 @@
0.94.6
0.94.7

View File

@ -303,7 +303,14 @@ func (db sqlitePersistence) HasPendingNotificationsForChat(chatID string) (bool,
return false, err
}
return rows.Next(), nil
result := false
if rows.Next() {
result = true
rows.Close()
}
return result, nil
}
func (db sqlitePersistence) GetActivityCenterNotificationsByID(ids []types.HexBytes) ([]*ActivityCenterNotification, error) {