mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-07-31 21:00:15 +02:00
BG Updates *should* work now
This commit is contained in:
@@ -32,17 +32,18 @@ bgUpdateCheck(int? ignoreAfterMicroseconds) async {
|
|||||||
// appsProvider.getExistingUpdates(installedOnly: true);
|
// appsProvider.getExistingUpdates(installedOnly: true);
|
||||||
List<String> existingUpdateIds =
|
List<String> existingUpdateIds =
|
||||||
appsProvider.getExistingUpdates(installedOnly: true);
|
appsProvider.getExistingUpdates(installedOnly: true);
|
||||||
// DateTime nextIgnoreAfter = DateTime.now();
|
DateTime nextIgnoreAfter = DateTime.now();
|
||||||
try {
|
try {
|
||||||
await appsProvider.checkUpdates(ignoreAfter: ignoreAfter);
|
await appsProvider.checkUpdates(ignoreAfter: ignoreAfter);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e is RateLimitError) {
|
if (e is RateLimitError) {
|
||||||
// Ignore these (scheduling another task as below does not work)
|
// Ignore these (scheduling another task as below does not work)
|
||||||
// Workmanager().registerOneOffTask(
|
String nextTaskName =
|
||||||
// bgUpdateCheckTaskName, bgUpdateCheckTaskName,
|
'$bgUpdateCheckTaskName-${nextIgnoreAfter.microsecondsSinceEpoch.toString()}';
|
||||||
// constraints: Constraints(networkType: NetworkType.connected),
|
Workmanager().registerOneOffTask(nextTaskName, nextTaskName,
|
||||||
// initialDelay: Duration(minutes: e.remainingMinutes),
|
constraints: Constraints(networkType: NetworkType.connected),
|
||||||
// inputData: {'ignoreAfter': nextIgnoreAfter.microsecondsSinceEpoch});
|
initialDelay: Duration(minutes: e.remainingMinutes),
|
||||||
|
inputData: {'ignoreAfter': nextIgnoreAfter.microsecondsSinceEpoch});
|
||||||
} else {
|
} else {
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
|
@@ -197,7 +197,7 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
'Large App collections may require multiple cycles',
|
'Longer intervals recommended for large App collections',
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.labelMedium!
|
.labelMedium!
|
||||||
|
Reference in New Issue
Block a user