Closed th0th closed 5 years ago
Thank you for the kind words!
This is somewhat expected. Dramatiq actors try to eagerly declare themselves as soon as the code runs. You can work around it by setting the broker to StubBroker
during the build, perhaps by using an environment variable.
That feels strange but I got your point, thanks for the explanation @Bogdanp đź‘Ť
Does this also fail with redis, or just with rmq? I don't recall running into this in the last project I used, but it's been a while.
@rpkilby Redis queues don't need to be pre-declared so this doesn't happen with Redis (see https://github.com/Bogdanp/dramatiq/blob/master/dramatiq/brokers/redis.py#L127-L141).
First of all, thanks for the awesome project.
I feel like title to this issue should be: "Actor somehow tries to run when manage.py collectstatic is run" but I didn't go with it since I am not sure that's the issue.
I am trying replace celery with dramatiq on an existing project. I started with installing dramatiq, django_dramatiq, updating settings.py and replacing celery decorators with
@dramatiq.actor
. But when I add@dramatiq.actor
decorator to any function and try to runcollectstatic
I get something like this:The rabbitmq server is not accessible during the build. If I delete the
@dramatiq.actor
decorator it runs without any errors.