GeoTecINIT / nativescript-task-dispatcher

NativeScript-based mobile background task scheduler and dispatcher
Apache License 2.0
18 stars 6 forks source link

fix: alarm-based task execution timeouts are no longer top-unbounded #52

Closed agonper closed 2 years ago

agonper commented 2 years ago

Closes #47

This solves the problem when alarm intervals are relatively high (10+ min) and a task gets stuck running.

Tasks executed by an alarm will have now between 1 to 3 minutes to complete their execution, making the alarm-based runner consistent with the event-based runner.


To plugin's users reading this: Why not keep the task execution unbounded? Android does not like long running services. By limiting the maximum time a task can be running we reduce the chances of Android killing the task execution service. If you need a long running process, run the task on a recurrent basis instead and save its progress at the end of the execution in order to continue the task in subsequent executions.

agonper commented 2 years ago

After a tireless and in-depth review of the changes, everything seems good. 😉

😂😂😂

"I was expecting this review to take a bit longer" 😜

Thanks @matey97!