-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
Hello and sorry for the amateur question..
I use the documentation and write my code like this:
in views.py:
from dramatiq import get_broker
from dramatiq_abort import Abortable, backends, abort
abortable = Abortable(backend=backends.RedisBackend())
get_broker().add_middleware(abortable)
...
def tesr_abort():
...
abort(message_id)
...
But I get this error get this error:
TypeError: RedisBackend.__init__() missing 1 required keyword-only argument: 'client'
My settings.py are the same as for django_dramatiq:
DRAMATIQ_REDIS_URL = os.getenv("REDIS_URL", "redis://127.0.0.1:6379/0")
DRAMATIQ_BROKER = {
"BROKER": "dramatiq.brokers.redis.RedisBroker",
"OPTIONS": {
"connection_pool": redis.ConnectionPool.from_url(DRAMATIQ_REDIS_URL),
},
"MIDDLEWARE": [
"dramatiq.middleware.AgeLimit",
"dramatiq.middleware.TimeLimit",
"dramatiq.middleware.Retries",
"django_dramatiq.middleware.AdminMiddleware",
"django_dramatiq.middleware.DbConnectionsMiddleware",
# "dramatiq.middleware.GroupCallbacks",
]
}
DRAMATIQ_RESULT_BACKEND = {
"BACKEND": "dramatiq.results.backends.redis.RedisBackend",
"BACKEND_OPTIONS": {
"url": "redis://localhost:6379",
},
"MIDDLEWARE_OPTIONS": {
"result_ttl": 1000 * 60 * 10
}
}
Please help me). What am I doing wrong?)
Metadata
Metadata
Assignees
Labels
No labels