Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 982
Greg Haskins Avatar asked Oct 10 '22 05:10

Greg Haskins


1 Answers

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)
like image 130
Robert Kluin Avatar answered Oct 13 '22 08:10

Robert Kluin