mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
fix: limit android background worker duration (#23566)
* fix: limit each android background run to 20 mins # Conflicts: # mobile/lib/domain/services/background_worker.service.dart * review chages --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
+4
-2
@@ -277,7 +277,7 @@ abstract class BackgroundWorkerFlutterApi {
|
||||
|
||||
Future<void> onIosUpload(bool isRefresh, int? maxSeconds);
|
||||
|
||||
Future<void> onAndroidUpload();
|
||||
Future<void> onAndroidUpload(int? maxMinutes);
|
||||
|
||||
Future<void> cancel();
|
||||
|
||||
@@ -323,8 +323,10 @@ abstract class BackgroundWorkerFlutterApi {
|
||||
pigeonVar_channel.setMessageHandler(null);
|
||||
} else {
|
||||
pigeonVar_channel.setMessageHandler((Object? message) async {
|
||||
final List<Object?> args = message! as List<Object?>;
|
||||
final int? arg_maxMinutes = args[0] as int?;
|
||||
try {
|
||||
await api.onAndroidUpload();
|
||||
await api.onAndroidUpload(arg_maxMinutes);
|
||||
return wrapResponse(empty: true);
|
||||
} on PlatformException catch (e) {
|
||||
return wrapResponse(error: e);
|
||||
|
||||
Reference in New Issue
Block a user