开发者

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

I realize that dev_appserver.py is meant to simulate t开发者_Go百科he 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.


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)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜