开发者

Django send_mail "lock already in place. quitting."

I am having an issue with send_mail in Django. It has been working fine until I tried to change some Email settings to have it use an 开发者_如何学GoEMAIL_HOST_USER and EMAIL_HOST_PASSWORD. When I did that my test emails where not sent.

I reverted back to my old email settings that did work and now it is still not sending emails. I have restarted things to make sure that my current settings are in effect. When I run the commmand 'python manage.py send_mail' to test I get this response:

acquiring lock... lock already in place. quitting.

In looking at the code in mailer.engine:

def send_all():
    """
    Send all eligible messages in the queue.
    """

    lock = FileLock("send_mail")

    logging.debug("acquiring lock...")
    try:
        lock.acquire(LOCK_WAIT_TIMEOUT)
    except AlreadyLocked:
        logging.debug("lock already in place. quitting.")
        return
    except LockTimeout:
        logging.debug("waiting for the lock timed out. quitting.")
        return
    logging.debug("acquired.")

    start_time = time.time()

    dont_send = 0
    deferred = 0
    sent = 0

It appears that because it gets the exception 'AlreadyLocked' it exits without sending the emails. If this is truly the case, how do I break this lock and start over?


most probably there is a "lock file" ('send_mail') in your directory - just remove it

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜