BG Updates *should* work now

This commit is contained in:
Imran Remtulla
2022-09-28 21:17:42 -04:00
parent dd193d62f2
commit 15c0ed04d1
2 changed files with 8 additions and 7 deletions

View File

@@ -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;
} }

View File

@@ -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!