react-native-background-worker icon indicating copy to clipboard operation
react-native-background-worker copied to clipboard

Auto remove worker when creating another worker with the same key

Open szyymoon opened this issue 4 years ago • 0 comments

I would suggest make an solution on case when I need to dynamic change of reapeatInterval in worker. For instance.

I need to create worker with 15 minutes reapet time for the first workflow occurs but later when workflow end I need to manipulete repaet interval to Increase or decrease its time. Ofcourse not less than 15 minutes.

Right now to do that I need to create helper consts that will take care of new interval values and when this value (baseInterval, newInterval) are not equals I have cancel actual worker and start new one with new interval. That cause warning on rn 63.4 -> "registerHeadelessTask or registerCancellableHeadlessTask called multiple times for same key"

Maybe you guys have better solution for that right now. Maybe ingeration in package will be unnecessary.

Regards

szyymoon avatar Dec 24 '20 10:12 szyymoon