Update lastEventDate only when we start the service
This commit is contained in:
parent
11dbfcd6e9
commit
38de5edeaa
|
@ -37,14 +37,16 @@ class RestartWorker(ctx: Context, params: WorkerParameters) : Worker(ctx, params
|
|||
Log.d(TAG, "We should have received an event before ${restartDate.time}. Restarting")
|
||||
/** We do not update [FailureHandler]'s counter, it will be done by the next requests. */
|
||||
StartService.startListener(applicationContext)
|
||||
// We consider this run as the first event
|
||||
AppCompanion.lastEventDate = currentDate
|
||||
}
|
||||
} ?: run {
|
||||
Log.d(TAG, "Restarting")
|
||||
StartService.startListener(applicationContext)
|
||||
}
|
||||
// We consider this run as the first event
|
||||
AppCompanion.lastEventDate = currentDate
|
||||
}
|
||||
}
|
||||
return Result.success()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue