Issue #6 invalid

rate_limit not enforced

Saul Shanabrook
created an issue

For some reason, Celery sends out all my emails at once. If I sent the rate_limit to say 1/m it has no effect.

Do I have to send each message as an individual task for it to work? Or break the email list up into chunks?

Comments (6)

  1. Saul Shanabrook reporter
    • changed status to open

    I solved this by breaking up my email list into chunks and sending them separately. However adding this to my settings:

    CELERY_EMAIL_TASK_CONFIG = {
        'rate_limit' : '1/m',
        'ignore_result': False,
    }
    

    had no effect on the tasks rate limit. I had to use

    CELERY_DEFAULT_RATE_LIMIT = '1/m'
    

    and then it worked. Is this a bug? I am doing something wrong?

  2. Saul Shanabrook reporter

    I solved this by breaking up my email list into chunks and sending them separately. However adding this to my settings:

    CELERY_EMAIL_TASK_CONFIG = {
        'rate_limit' : '1/m',
        'ignore_result': False,
    }
    

    had no effect on the tasks rate limit. I had to use

    CELERY_DEFAULT_RATE_LIMIT = '1/m'
    

    and then it worked. Is this a bug? I am doing something wrong?

  3. Paul McLanahan repo owner

    I was never able to reproduce. I have a test that seems to prove that it's working, though it's possible that the test is wrong. Are you experiencing this too jmagnusson?

  4. Log in to comment