react-native-queue icon indicating copy to clipboard operation
react-native-queue copied to clipboard

Job stuck in "active" state

Open colaskirschoff opened this issue 6 years ago • 3 comments

I have a queue of jobs that is started in background whenever there is connexion. It's been three days that one job is stuck in the queue, while more recent jobs were processed without any issue.

{ "0": { "id": "34c7d35c-8c43-48f3-ac17-880029a7d747", "name": "place-association", "payload": "{"stopId":"576e78b9-fa5b-472f-89e9-5c1e3ace7d7b"}", "data": "{"attempts":1}", "priority": 10, "active": true, "timeout": 5000, "created": "2018-08-24T19:38:21.128Z", "failed": null } }

For now I set active to false to start it back. Any idea of what's happening ? Thx :)

colaskirschoff avatar Aug 27 '18 13:08 colaskirschoff

I have the same problem. It happens whenever i stop queue from processing.

lyseiha avatar Dec 05 '18 08:12 lyseiha

const initialQuery = (queueLifespanRemaining) ? 'active == FALSE AND failed == null AND timeout > 0 AND timeout < ' + timeoutUpperBound : 'active == FALSE AND failed == null';

yeah it only process queue that are not active and will skip those active ones i wonder if changing this query to something like:

const initialQuery = (queueLifespanRemaining) ? 'failed == null AND timeout > 0 AND timeout < ' + timeoutUpperBound : 'failed == null'; so that it will process queue as long as it wont hit the retry count? because there are cases like app was forcefully closed and it is already set to active then boom we cant run that job again

rheilgm avatar Dec 06 '18 04:12 rheilgm

This sounds similar to #24 . @billmalarky explains what's going on there and I posted a rough work-around.

famousfilm avatar Jun 05 '19 22:06 famousfilm