Add developer option to optimize the SDK DBs
This commit is contained in:
parent
0c60b75709
commit
5d6aa1fcfd
6 changed files with 49 additions and 0 deletions
|
|
@ -194,6 +194,8 @@ interface MatrixClient {
|
|||
* Use [Timeline.markAsRead] instead when possible.
|
||||
*/
|
||||
suspend fun markRoomAsFullyRead(roomId: RoomId, eventId: EventId): Result<Unit>
|
||||
|
||||
suspend fun vacuumStores(): Result<Unit>
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -726,6 +726,12 @@ class RustMatrixClient(
|
|||
}
|
||||
}
|
||||
|
||||
override suspend fun vacuumStores(): Result<Unit> = withContext(sessionDispatcher) {
|
||||
runCatchingExceptions {
|
||||
innerClient.optimizeStores()
|
||||
}
|
||||
}
|
||||
|
||||
private suspend fun getCacheSize(
|
||||
includeCryptoDb: Boolean = false,
|
||||
): Long = withContext(sessionDispatcher) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue