-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: startPeriodicTask doesn't always run exactly on the given interval #4
Comments
Is it not running at all or is it running and get stack after the I found a bug that the |
I think I found the problem, when the OS stops the service the task restart its delay and not continue it from where it stops I will fix this on the next update |
I uploaded a new update (0.1.7) which should fix this problem |
sorry for not opening new issue but startPeriodikTask is not working when i activate the screen lock. if i close screen lock then startPeriodikTask is going to work well. So is there a way working on screen lock? |
It's doesn't always work for me, don't really know what the problem could be. But I think it has to do something with the battery optimization done by android. And when the phone is in doze mode it also doesn't run on the given period. |
Which phone do you testing on? |
redmi note 4.x. and one issues too. For example foreground service time duration is 10 seconds. And startPeriodicTask is getting 20 seconds. So foreground service opens a new startPeriodicTask instance. Thts a problem. ForeGround Service must be wait the startPeriodicTask is finished then. Foreground service time duration should be start, i think. |
I fixed this problem in the last update (0.1.7). When the OS stops the service and the timer (task) is running I added a calculation to the new created timer which caclute the delay. For example if the period is 20 min and the service killed after 10 min the delay will be 10 min in the new created timer |
@yakupbaser @toonvanstrijp Can you try to run the example app and see if the task not executing there too? btw use the latest update |
I'm using the startPeriodicTask which works well, but it doesn't always run on the given interval.
I'm setting it up as followed:
Then my
periodicTaskFun
:The text was updated successfully, but these errors were encountered: