diff --git a/app/src/main/java/org/unifiedpush/distributor/nextpush/services/RestartWorker.kt b/app/src/main/java/org/unifiedpush/distributor/nextpush/services/RestartWorker.kt index fc7201d..e69fa93 100644 --- a/app/src/main/java/org/unifiedpush/distributor/nextpush/services/RestartWorker.kt +++ b/app/src/main/java/org/unifiedpush/distributor/nextpush/services/RestartWorker.kt @@ -31,8 +31,10 @@ class RestartWorker (ctx: Context, params: WorkerParameters) : Worker(ctx, param override fun doWork(): Result { Log.d(TAG, "Working") val currentDate = Calendar.getInstance() - val restartDate = lastEventDate?.add(Calendar.MINUTE, 15) + val restartDate = lastEventDate + restartDate?.add(Calendar.MINUTE, 15) if (restartDate == null || currentDate.after(restartDate)) { + Log.d(TAG, "Restarting") StartService.startListener(applicationContext) } return Result.success()