示例#1
0
def appengine_warmup(request):
    """Called periodically on new app engine instances.

    See Warming Requests in
    http://code.google.com/appengine/docs/python/config/appconfig.html

    """
    log.info("Warming up")
    taskqueue.add(url="/api/current_playlist", method="GET")
    load_dbconfig_into_memcache()
    return HttpResponse("it's getting hot in here")
示例#2
0
def appengine_warmup(request):
    """Called periodically on new app engine instances.

    See Warming Requests in
    http://code.google.com/appengine/docs/python/config/appconfig.html

    """
    log.info("Warming up")
    taskqueue.add(url='/api/current_playlist', method='GET')
    load_dbconfig_into_memcache()
    return HttpResponse("it's getting hot in here")
示例#3
0
 def test_load_dbconfig_into_memcache(self):
     dbconfig['one'] = '1'
     dbconfig['two'] = '2'
     dbconfig['three'] = 'three'
     assert memcache.flush_all()
     load_dbconfig_into_memcache()
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['one'], '1')
     self.assertEqual(dbconfig['two'], '2')
     self.assertEqual(dbconfig['three'], 'three')
 def test_load_dbconfig_into_memcache(self):
     dbconfig['one'] = '1'
     dbconfig['two'] = '2'
     dbconfig['three'] = 'three'
     assert memcache.flush_all()
     load_dbconfig_into_memcache()
     for c in Config.all():
         c.delete()
     # should be in memcache:
     self.assertEqual(dbconfig['one'], '1')
     self.assertEqual(dbconfig['two'], '2')
     self.assertEqual(dbconfig['three'], 'three')