Bogdanp / django_dramatiq

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

Can not set encoder in BACKEND_OPTIONS of dramatiq_results as string #77

Closed horpto closed 3 years ago

horpto commented 3 years ago

settings.py:

DRAMATIQ_ENCODER = "dramatiq.encoder.PickleEncoder"
...
DRAMATIQ_RESULT_BACKEND = {
    "BACKEND": "dramatiq.results.backends.redis.RedisBackend",
    "BACKEND_OPTIONS": {
        "url": get_env_param_str('PERSISTENT_CACHE_URL', "redis://localhost:6379"),
        "encoder": DRAMATIQ_ENCODER,
    },
    "MIDDLEWARE_OPTIONS": {
        "result_ttl": 60000,
    },
}

will cause TypeError: encode() argument 'encoding' must be str, not tuple. It's inconsistent with type of DRAMATIQ_ENCODER.

Bogdanp commented 3 years ago

Can you give some more details? This seems to work when I try it. A stack trace would be helpful.

Bogdanp commented 3 years ago

Closing for now. Feel free to reopen with more details.