Dramatiq fails if rabbitmq hasn't been started #10
Comments
Oops! That should say "channel" not "consumer". Normally what would happen here (assuming the attribute was correctly named) is the process would exit with a return code of I'll fix the Thanks! |
I fixed the attribute error in #!/usr/bin/env bash
delay=1
while true; do
env PYTHONPATH=. dramatiq foo
if [ $? -eq 3 ]; then
echo "Connection error encountered on startup. Retrying in $delay second(s)..."
sleep $delay
delay=$((delay * 2))
else
break
fi
done |
I added that as an example to the cookbook: https://dramatiq.io/cookbook.html#retrying-connection-errors-on-startup Thanks again! |
I noticed this when running dramatiq and django_dramatiq in docker while rabbitmq is still starting. Would it make sense to implement a retry with exponential backoff?
The text was updated successfully, but these errors were encountered: