azure-queue-laravel
azure-queue-laravel copied to clipboard
Make the queue clearable
Added functionality to make the Azure queue clearable. This will make php artisan queue:clear
work.
Thanks for the contribution.
According to the documentation this method can still return 500 error with OperationTimedOut
and suggests retrying. Perhaps we should handle this error and continually retry until the clearing has succeeded?
The behaviour of php artisan queue:clear
would then be blocking until the queue is actually fully cleared, rather than potentially failing.
How about this?
@squigg What do you think of the solution I implemented?
Hey, sorry for the delay. I think we need to be more specific about the ServiceException
being caught here, as this exception can occur for many other reasons beyond just the timeout we are keen to retry on.
I had a quick look and it seems that the code that parses the response in ServiceException
doesn't save the code property from the XML error format.
I'm not sure whether the errorText
or errorMessage
properties would include the OperationTimedOut
error code or not, but if they don't then the full XML response
is available and we could do a rudimentary check here to confirm whether or not it's failed for a timeout and just retry in that case.