-
Hi, thanks for the amazing package. I'm new to both I added It was working fine before installing This is my # settings.py
INSTALLED_APPS = [
...
"django_dramatiq",
"pictures",
...
"myapp",
]
DRAMATIQ_BROKER = {
"BROKER": "dramatiq.brokers.redis.RedisBroker",
"OPTIONS": {
"url": env("REDIS_URL", "redis://127.0.0.1:6379"),
},
"MIDDLEWARE": [
"dramatiq.middleware.Prometheus",
"dramatiq.middleware.AgeLimit",
"dramatiq.middleware.TimeLimit",
"dramatiq.middleware.Callbacks",
"dramatiq.middleware.Retries",
"django_dramatiq.middleware.DbConnectionsMiddleware",
"django_dramatiq.middleware.AdminMiddleware",
],
}
DRAMATIQ_RESULT_BACKEND = {
"BACKEND": "dramatiq.results.backends.redis.RedisBackend",
"BACKEND_OPTIONS": {
"url": env("REDIS_URL", "redis://127.0.0.1:6379"),
},
"MIDDLEWARE_OPTIONS": {"result_ttl": 1000 * 60 * 10},
} My model file: # myapp/models.py
from django.db import models
from pictures.models import PictureField
class MyModel(models.Model):
pictures = PictureField(
upload_to="myapp/pictures/%Y/%m/%d/",
aspect_ratios=[None, "1/1", "3/2", "16/9"],
null=True,
blank=True,
) Checked list:
key: dramatiq:pictures
value: ["c9166cce-e49b-4efd-81be-f62c1ad5dbbe"]
key: dramatiq:__heartbeats__
value: [{"value":"174e8865-67b4-4672-8202-ee16ca39c08f","score":"1672767537326"}]
key: dramatiq:pictures.msgs
value: {"c9166cce-e49b-4efd-81be-f62c1ad5dbbe":"{\"queue_name\":\"pictures\",\"actor_name\":\"process_picture_with_dramatiq\",\"args\":[],\"kwargs\":{\"app_name\":\"myapp\",\"model_name\":\"mymodel\",\"field_name\":\"pictures\",\"file_name\":\"myapp\/pictures\/2023\/01\/03\/mypicture.png\",\"storage_construct\":[\"django.core.files.storage.FileSystemStorage\",[],{}]},\"options\":{\"redis_message_id\":\"c9166cce-e49b-4efd-81be-f62c1ad5dbbe\"},\"message_id\":\"e39f3496-0957-4e1f-b6bf-4e0a8fb909de\",\"message_timestamp\":1672767537326}"} Versions: Django==4.1.4
django-dramatiq==0.11.2
django-pictures==1.0.0
djangorestframework==3.14.0
dramatiq==1.13.0 Am I doing something wrong in Similar to #66 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @thatsaw, Thank you for reaching out. I took the liberty to move your issue into a discussion. Since we are testing the dramatiq integration in our test suite, my guess is: It works, but it's not well documented how. Based on the provided, I see that the message was sent to your Redis broker. Yet, if you are missing the pictures, maybe your worker doesn't pick up tasks from the To help you debug this, perhaps you can answer me some questions. How do you run your dramatiq worker? Can you perhaps share the output? It needs to listen to the queue In terms of requirements management, I'd recommend installing Cheers! |
Beta Was this translation helpful? Give feedback.
Hi @thatsaw,
Thank you for reaching out. I took the liberty to move your issue into a discussion. Since we are testing the dramatiq integration in our test suite, my guess is: It works, but it's not well documented how.
Based on the provided, I see that the message was sent to your Redis broker. Yet, if you are missing the pictures, maybe your worker doesn't pick up tasks from the
pictures
queue.To help you debug this, perhaps you can answer me some questions. How do you run your dramatiq worker? Can you perhaps share the output? It needs to listen to the queue
pictures
, you can test if it does that be writing your own dramatiq task and see if it gets executed.In terms of requirements m…