When the backend code picks up an image, we set the status to "processing" in the queue. But if the code fails in any case, it's not handled and it remains in "processing" state.
A better approach would be:
Allot a time for processing to happen; if it doesn't get processed within that time, set it to retry or mark it as "failed"
If retry is configured, set a maximum number of retries before it gets marked as failed.
This is straightforward to do, and can be done with changes in the worker.js script alone.
When the backend code picks up an image, we set the status to "processing" in the queue. But if the code fails in any case, it's not handled and it remains in "processing" state.
A better approach would be:
This is straightforward to do, and can be done with changes in the worker.js script alone.