mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-04-18 14:42:54 +00:00
lower lastExecutionInSecondsLimit
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run
This commit is contained in:
parent
fdb11d1a9b
commit
8810ecf360
3 changed files with 5 additions and 3 deletions
|
|
@ -7,6 +7,7 @@
|
||||||
- Improve: Improved troubleshooting for issues with push notifications
|
- Improve: Improved troubleshooting for issues with push notifications
|
||||||
- Fix: Flash not activated when starting a video recording
|
- Fix: Flash not activated when starting a video recording
|
||||||
- Fix: Problem sending media when a recipient has deleted their account.
|
- Fix: Problem sending media when a recipient has deleted their account.
|
||||||
|
- Fix: Receive push notifications without receiving an in-app message (Android)
|
||||||
- Fix: Incorrect processing of messages that have already been fetched from the server causes the UI to freeze
|
- Fix: Incorrect processing of messages that have already been fetched from the server causes the UI to freeze
|
||||||
|
|
||||||
## 0.1.1
|
## 0.1.1
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ Future<bool> initBackgroundExecution() async {
|
||||||
|
|
||||||
final Mutex _keyValueMutex = Mutex();
|
final Mutex _keyValueMutex = Mutex();
|
||||||
|
|
||||||
Future<void> handlePeriodicTask() async {
|
Future<void> handlePeriodicTask({int lastExecutionInSecondsLimit = 120}) async {
|
||||||
final shouldBeExecuted = await exclusiveAccess(
|
final shouldBeExecuted = await exclusiveAccess(
|
||||||
lockName: 'periodic_task',
|
lockName: 'periodic_task',
|
||||||
mutex: _keyValueMutex,
|
mutex: _keyValueMutex,
|
||||||
|
|
@ -96,7 +96,8 @@ Future<void> handlePeriodicTask() async {
|
||||||
final lastExecutionDate = DateTime.fromMillisecondsSinceEpoch(
|
final lastExecutionDate = DateTime.fromMillisecondsSinceEpoch(
|
||||||
lastExecutionTime,
|
lastExecutionTime,
|
||||||
);
|
);
|
||||||
if (DateTime.now().difference(lastExecutionDate).inMinutes < 2) {
|
if (DateTime.now().difference(lastExecutionDate).inSeconds <
|
||||||
|
lastExecutionInSecondsLimit) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
|
||||||
|
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
if (isInitialized) {
|
if (isInitialized) {
|
||||||
await handlePeriodicTask();
|
await handlePeriodicTask(lastExecutionInSecondsLimit: 10);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// make sure every thing run...
|
// make sure every thing run...
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue