From 3f6d96289d8b30d34e2a0bf515e60dd839cb60f3 Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Tue, 22 Aug 2023 18:13:28 -0400 Subject: [PATCH] Bugfix, logging --- lib/main.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 165d6b1..a670d8f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -157,9 +157,11 @@ Future bgUpdateCheck(int taskId, Map? params) async { toInstall = moveStrToEnd(toInstall, obtainiumId); String appId = toInstall.removeAt(0); logs.add( - 'BG update task $taskId: Attempting to update $appId in the background.'); + 'BG update task $taskId: Attempting to download $appId in the background.'); await appsProvider.downloadAndInstallLatestApps([appId], null, notificationsProvider: notificationsProvider); + logs.add( + 'BG update task $taskId: Attempting to update $appId in the background.'); } if (toCheck.isNotEmpty || toInstall.isNotEmpty) { @@ -264,11 +266,11 @@ class _ObtainiumState extends State { var settingChanged = existingUpdateInterval != -1; var lastCheckWasTooLongAgo = actualUpdateInterval != 0 && settingsProvider.lastBGCheckTime - .add(Duration(seconds: actualUpdateInterval + 60)) + .add(Duration(minutes: actualUpdateInterval + 60)) .isBefore(DateTime.now()); if (settingChanged || lastCheckWasTooLongAgo) { logs.add( - 'Update interval was set to ${actualUpdateInterval.toString()} (reason: ${settingChanged ? 'setting changed' : 'last check was too long ago or never'}).'); + 'Update interval was set to ${actualUpdateInterval.toString()} (reason: ${settingChanged ? 'setting changed' : 'last check was ${settingsProvider.lastBGCheckTime.toLocal().toString()}'}).'); AndroidAlarmManager.periodic( Duration(minutes: actualUpdateInterval), bgUpdateCheckAlarmId,