M
M
mr_drinkens892015-04-13 12:39:40
Django
mr_drinkens89, 2015-04-13 12:39:40

How to properly organize celery redis queues?

Good day. Tell me, knowledgeable people.
I have created my "broadcast" application. The situation is such that you need to create several mailings (10 pieces), and each set its own time (day, month, time).
I indicated in the task

@task(name='mailer.send_db_mail', default_retry_delay=SEND_RETRY_DELAY)
def send_db_mail(*args, **kwargs):
    from mailer.send_mail import SendMail
    from models import MailTemplate,Subscriber

    try:
        subscriber = Subscriber.objects.filter(is_finish=False).order_by("date_send")[0]
        if subscriber:
                   #рассылаем

that is, when the mailing is completed, an inactivity checker is set.
How can I organize queues? So that if the last mailing has not yet ended, we are waiting.
Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shandrinov, 2015-04-13
@suguby

There are groupings of tasks in Celery in Celery celery.readthedocs.org/en/latest/userguide/canvas....
Probably chain will suit you - each next task is executed after the end of the previous one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question