There are two definitions of DeadlineExceededError

google/appengine/runtime/__init__.py
class DeadlineExceededError(BaseException):
  """Exception raised when the request reaches its overall time limit.
  Not to be confused with runtime.apiproxy_errors.DeadlineExceededError.
  That one is raised when individual API calls take too long.
  """

google/appengine/runtime/apiproxy_errors.py
class DeadlineExceededError(Error):
  """Raised by APIProxy calls if the call took too long to respond."""


2009/10/29 Greg Tracy <[email protected]>:
>
>
> I'm running an email distribution list that utilizes the taskqueue to
> send out emails to individuals recipients. Periodically, I'm getting
> DeadlineExceededError when the Mail.send() call doesn't return fast
> enough. (This alone would be nice to avoid, but that's for another
> day).
>
> File "/base/python_lib/versions/1/google/appengine/api/
> apiproxy_rpc.py", line 111, in CheckSuccess
>    raise self.exception
> DeadlineExceededError: The API call mail.Send() took too long to
> respond and was cancelled.
>
> I've tried catching the exception without success. This is what I've
> tried...
>
> from google.appengine.runtime import DeadlineExceededError
> class EmailWorker(webapp.RequestHandler):
>    def post(self):
>
>        try:
>            # send email
>            message = mail.EmailMessage
> ()
>            # setup message properties...
>            apod_message.send()
>
>        except DeadlineExceededError:
>            logging.info("DeadlineExceededError exception!?! Try to
> set status and return normally")
>            self.response.clear()
>            self.response.set_status(200)
>            self.response.out.write("Task took to long for %s - BAIL!"
> % email)
>
> Right now, this results in the task failing (no exception caught), but
> the mail message succeeding. Then the task gets re-queued and the
> recipient gets the message for the second time.
>
> Thoughts?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to