Bogdanp / django_dramatiq

A Django app that integrates with Dramatiq.
https://dramatiq.io
Other
347 stars 77 forks source link

rundramatiq finds too many tasks modules #33

Closed ghost closed 5 years ago

ghost commented 5 years ago

I'm looking to replace Celery with something better and I've tried both Huey and now Dramatiq, but they both suffer from the same issue, which is that they find "too many" tasks modules which I don't want to use.

My project depends on django_slack which has a tasks module which is intended for use with Celery. The module tries to import celery and this results in an ImportError.

This is my comment on the Huey project: https://github.com/coleifer/huey/pull/362#issuecomment-477206601

Bogdanp commented 5 years ago

You can work around this by creating a command in your project that subclasses the rundramatiq command and replacing discover_tasks_modules with an implementation that suits your project.

Bogdanp commented 5 years ago

Either that or run dramatiq yourself, without the dramatiq command.

denizdogan commented 5 years ago

@Bogdanp Would you be open to a PR which adds an optional DRAMATIQ_IGNORED_MODULES setting?

Bogdanp commented 5 years ago

@denizdogan sure!

Bogdanp commented 5 years ago

The new DRAMATIQ_IGNORED_MODULES setting has been released under version 0.7.0.