Skip to content

amateur question #34

@daniildotpl

Description

@daniildotpl

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions