Add method to delete old messages periodically

fixes #413
This commit is contained in:
Konstantinos Sideris 2018-08-25 21:08:43 +03:00
parent 199a4eaf51
commit 345dca3544
3 changed files with 77 additions and 2 deletions

View file

@ -1070,6 +1070,11 @@ ChatPage::trySync()
emit syncTopBar(updates);
emit syncRoomlist(updates);
cache::client()->deleteOldData();
} catch (const lmdb::map_full_error &e) {
nhlog::db()->error("lmdb is full: {}", e.what());
cache::client()->deleteOldData();
} catch (const lmdb::error &e) {
nhlog::db()->error("saving sync response: {}", e.what());
}