mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
Reduce background monitor time to reduce battery usage.
This commit is contained in:
@@ -43,7 +43,7 @@ open class App : Application(), Configuration.Provider {
|
||||
private fun setupWorker() {
|
||||
log(TAG) { "setupWorker()" }
|
||||
val workRequest = PeriodicWorkRequestBuilder<MonitorWorker>(
|
||||
Duration.ofMinutes(15),
|
||||
Duration.ofMinutes(25),
|
||||
Duration.ofMinutes(5)
|
||||
).apply {
|
||||
setInputData(Data.Builder().build())
|
||||
|
||||
@@ -86,12 +86,12 @@ class MonitorWorker @AssistedInject constructor(
|
||||
|
||||
val monitorJob = podMonitor.mainDevice
|
||||
.filterNotNull()
|
||||
.take(5)
|
||||
.take(3)
|
||||
.setupCommonEventHandlers(TAG) { "monitorJob" }
|
||||
.launchIn(workerScope)
|
||||
|
||||
try {
|
||||
withTimeout(60 * 1000) {
|
||||
withTimeout(15 * 1000) {
|
||||
monitorJob.join()
|
||||
}
|
||||
log(TAG) { "Monitor job quit after a few takes." }
|
||||
|
||||
Reference in New Issue
Block a user