mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-13 02:18:10 +02:00
Bugfix, logging
This commit is contained in:
@@ -157,9 +157,11 @@ Future<void> bgUpdateCheck(int taskId, Map<String, dynamic>? params) async {
|
|||||||
toInstall = moveStrToEnd(toInstall, obtainiumId);
|
toInstall = moveStrToEnd(toInstall, obtainiumId);
|
||||||
String appId = toInstall.removeAt(0);
|
String appId = toInstall.removeAt(0);
|
||||||
logs.add(
|
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,
|
await appsProvider.downloadAndInstallLatestApps([appId], null,
|
||||||
notificationsProvider: notificationsProvider);
|
notificationsProvider: notificationsProvider);
|
||||||
|
logs.add(
|
||||||
|
'BG update task $taskId: Attempting to update $appId in the background.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toCheck.isNotEmpty || toInstall.isNotEmpty) {
|
if (toCheck.isNotEmpty || toInstall.isNotEmpty) {
|
||||||
@@ -264,11 +266,11 @@ class _ObtainiumState extends State<Obtainium> {
|
|||||||
var settingChanged = existingUpdateInterval != -1;
|
var settingChanged = existingUpdateInterval != -1;
|
||||||
var lastCheckWasTooLongAgo = actualUpdateInterval != 0 &&
|
var lastCheckWasTooLongAgo = actualUpdateInterval != 0 &&
|
||||||
settingsProvider.lastBGCheckTime
|
settingsProvider.lastBGCheckTime
|
||||||
.add(Duration(seconds: actualUpdateInterval + 60))
|
.add(Duration(minutes: actualUpdateInterval + 60))
|
||||||
.isBefore(DateTime.now());
|
.isBefore(DateTime.now());
|
||||||
if (settingChanged || lastCheckWasTooLongAgo) {
|
if (settingChanged || lastCheckWasTooLongAgo) {
|
||||||
logs.add(
|
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(
|
AndroidAlarmManager.periodic(
|
||||||
Duration(minutes: actualUpdateInterval),
|
Duration(minutes: actualUpdateInterval),
|
||||||
bgUpdateCheckAlarmId,
|
bgUpdateCheckAlarmId,
|
||||||
|
Reference in New Issue
Block a user