凡DeadlineExceededError來自哪裏?我認爲截止日期是在某個地方初始化的,而不是硬編碼的值。如果你使用download the source code並查看google.appengine.api.apiproxy_rpc.py,你可以看看初始化器。
class RPC(object):
"""Base class for implementing RPC of API proxy stubs.
To implement a RPC to make real asynchronous API call:
- Extend this class.
- Override _MakeCallImpl and/or _WaitImpl to do a real asynchronous call.
"""
IDLE = 0
RUNNING = 1
FINISHING = 2
def __init__(self, package=None, call=None, request=None, response=None,
callback=None, deadline=None, stub=None):
"""Constructor for the RPC object.
All arguments are optional, and simply set members on the class.
These data members will be overriden by values passed to MakeCall.
Args:
package: string, the package for the call
call: string, the call within the package
request: ProtocolMessage instance, appropriate for the arguments
response: ProtocolMessage instance, appropriate for the response
callback: callable, called when call is complete
deadline: A double specifying the deadline for this call as the number of
seconds from the current time. Ignored if non-positive.
stub: APIProxyStub instance, used in default _WaitImpl to do real call
"""
self.__exception = None
self.__state = RPC.IDLE
self.__traceback = None
self.package = package
self.call = call
self.request = request
self.response = response
self.callback = callback
self.deadline = deadline
self.stub = stub
self.cpu_usage_mcycles = 0
以我的經驗不到一秒執行
clean_up()
,我還沒有看到一個證明了這一點,並且你並不總是得到寬限期,這很大程度上取決於你爲什麼得到DEE。 –