azure-queue-laravel icon indicating copy to clipboard operation
azure-queue-laravel copied to clipboard

Make the queue clearable

Open rikmorskate opened this issue 2 years ago • 4 comments

Added functionality to make the Azure queue clearable. This will make php artisan queue:clear work.

rikmorskate avatar Jul 17 '22 12:07 rikmorskate

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.

squigg avatar Jul 19 '22 03:07 squigg

How about this?

rikmorskate avatar Aug 13 '22 08:08 rikmorskate

@squigg What do you think of the solution I implemented?

rikmorskate avatar Sep 21 '22 13:09 rikmorskate

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.

squigg avatar Sep 22 '22 10:09 squigg