Add a periodic DB vacuuming task

This commit is contained in:
Jorge Martín 2025-12-05 14:19:36 +01:00 committed by Jorge Martin Espinosa
parent 9c72310cb4
commit 482d7e0648
22 changed files with 172 additions and 21 deletions

View file

@ -104,6 +104,7 @@ class FakeMatrixClient(
private val getRecentEmojisLambda: () -> Result<List<String>> = { Result.success(emptyList()) },
private val addRecentEmojiLambda: (String) -> Result<Unit> = { Result.success(Unit) },
private val markRoomAsFullyReadResult: (RoomId, EventId) -> Result<Unit> = { _, _ -> lambdaError() },
private val performDatabaseVacuumLambda: () -> Result<Unit> = { lambdaError() },
) : MatrixClient {
var setDisplayNameCalled: Boolean = false
private set
@ -351,4 +352,8 @@ class FakeMatrixClient(
override suspend fun markRoomAsFullyRead(roomId: RoomId, eventId: EventId): Result<Unit> {
return markRoomAsFullyReadResult(roomId, eventId)
}
override suspend fun performDatabaseVacuum(): Result<Unit> {
return performDatabaseVacuumLambda()
}
}