1
0
mirror of https://github.com/immich-app/immich.git synced 2025-06-22 04:28:11 +02:00

feat(mobile): configurable background backup delay (#1068)

let's the user configure how much to delay the trigger for running the backup whenever assets are changed on the device
This commit is contained in:
Fynn Petersen-Frey
2022-12-08 16:51:36 +01:00
committed by GitHub
parent a97b761eda
commit c23b2479f7
8 changed files with 122 additions and 12 deletions

View File

@ -86,6 +86,8 @@ class BackgroundService {
Future<bool> configureService({
bool requireUnmetered = true,
bool requireCharging = false,
int triggerUpdateDelay = 5000,
int triggerMaxDelay = 50000,
}) async {
if (!Platform.isAndroid) {
return true;
@ -93,7 +95,12 @@ class BackgroundService {
try {
final bool ok = await _foregroundChannel.invokeMethod(
'configure',
[requireUnmetered, requireCharging],
[
requireUnmetered,
requireCharging,
triggerUpdateDelay,
triggerMaxDelay
],
);
return ok;
} catch (error) {