문제

I am trying to send emails via mandrill inside push taskqueue. On the first attempt of the task, the email is sent, urlfetch.fetch results is 200 but task fails and is queued for the second attempt. On second attempt, mail is re-sent and task completes with a 200 status. Here is code snippet

try:
    result = urlfetch.fetch(url=<MANDRILL_SEND_URL>,
                            method=urlfetch.POST,
                            deadline=60,
                            payload=json.dumps(mail_params))
    if result.status_code == 200:
        # return 200 response (using flask with GAE)
        return "", 200  
except Exception as e:
        logging.error("100 - Exception while sending email: {0}".format(e))

Email is critical to flow, so I need to make sure email is sent so re-tries of tasks are needed.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top