Greg Haskins
Greg Haskins

Reputation: 6794

Is there a way to disable built-in deadlines on App Engine dev_appserver?

I realize that dev_appserver.py is meant to simulate the production App Engine environment as much as possible, but I'm having trouble debugging an app locally due to slow connection issues (I keep getting DeadlineExceededError exceptions). Since it's not the connection itself that I'm concerned about, is there any way to temporarily disable/extend the timeout for urlfetch (and others) just for the development environment? Unfortunately, the app does need to be connected to a live webservice, and I can't just patch in a dummy response in this case.

This may be a simple fix for someone who knows more about the innards of the SDK, but I haven't had much luck in my Googling. I would appreciate any help or advice you may have.

Upvotes: 5

Views: 358

Answers (1)

Robert Kluin
Robert Kluin

Reputation: 8292

When running on the development server, you could set a higher default urlfetch deadline:

import os
if os.environ['SERVER_SOFTWARE'].startswith('Dev'):
    from google.appengine.api import urlfetch
    urlfetch.set_default_fetch_deadline(60)

Upvotes: 4

Related Questions