Created
January 9, 2011 21:50
-
-
Save tokibito/772067 to your computer and use it in GitHub Desktop.
missing cache variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from google.appengine.ext.webapp import util | |
cachevar = None # キャッシュ用変数 | |
def application(environ, start_response): | |
global cachevar | |
if cachevar is None: | |
msg = '%s' | |
cachevar = [] | |
for i in range(10): | |
cachevar.append(i) | |
# 意図的に例外を発生させる | |
#if i == 5: | |
# from google.appengine.runtime import DeadlineExceededError | |
# raise DeadlineExceededError | |
else: | |
msg = 'hit: %s' | |
start_response('200 OK', [('Content-Type', 'text/plain')]) | |
return msg % str(cachevar) | |
def main(): | |
util.run_wsgi_app(application) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment