Add scheduled profile update

This commit is contained in:
problematicconsumer
2023-09-30 11:15:20 +03:30
parent b60b22d694
commit eb4db44c06
7 changed files with 105 additions and 5 deletions

View File

@@ -66,11 +66,11 @@ class AppUpdateNotifier extends _$AppUpdateNotifier with AppLogger {
).run();
}
void _schedule() {
Future<void> _schedule() async {
loggy.debug("scheduling app update checker");
ref.watch(cronServiceProvider).schedule(
return ref.read(cronServiceProvider).schedule(
key: 'app_update',
duration: const Duration(hours: 4),
duration: const Duration(hours: 8),
callback: () async {
await Future.delayed(const Duration(seconds: 5));
final updateState = await check();