Closed moritz89 closed 7 months ago
After further research it is probably due to user code :sweat_smile: but it does not seem trivial...
It was trivial, was calling enable()
after the task was created/constructor called... sorry for the commotion. Lesson: sleep on it and debug the next day
This might be a communication issue regarding the documentation and function naming, but when creating a task and the calling
enableDelayed(wait_time_ms)
in the constructor, the Callback is called immediately after without respecting the delay. There seems to be no difference betweenenableDelayed()
andenable()
when used in the class interface.A work-around is to manually handle the first iteration by saving the initial delay to a class member and then in the callback handling the first iteration manually:
Might this not be a problem if using this approach: https://github.com/arkhipenko/TaskScheduler/issues/78#issuecomment-538408706