Add a periodic DB vacuuming task
This commit is contained in:
parent
5d6aa1fcfd
commit
734485255a
22 changed files with 172 additions and 21 deletions
|
|
@ -12,16 +12,19 @@ import io.element.android.libraries.matrix.api.core.SessionId
|
|||
|
||||
interface WorkManagerScheduler {
|
||||
fun submit(workManagerRequest: WorkManagerRequest)
|
||||
fun hasPendingWork(sessionId: SessionId, requestType: WorkManagerRequestType): Boolean
|
||||
fun cancel(sessionId: SessionId)
|
||||
}
|
||||
|
||||
fun workManagerTag(sessionId: SessionId, requestType: WorkManagerRequestType): String {
|
||||
val prefix = when (requestType) {
|
||||
WorkManagerRequestType.NOTIFICATION_SYNC -> "notifications"
|
||||
WorkManagerRequestType.DB_VACUUM -> "db_vacuum"
|
||||
}
|
||||
return "$prefix-$sessionId"
|
||||
}
|
||||
|
||||
enum class WorkManagerRequestType {
|
||||
NOTIFICATION_SYNC,
|
||||
DB_VACUUM,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue