mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Add a periodic DB vacuuming task
This commit is contained in:
committed by
Jorge Martin Espinosa
parent
5d6aa1fcfd
commit
734485255a
+3
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user