예제 #1
0
 def migrate_all(self, batch_size=20, items=None):
   if items is None:
     items = self._get_posts()
   logging.warn('Start processing of %d items', len(items))
   for item in items[:batch_size]:
     self.migrate_one(item)
   if items[batch_size:]:
     deferred.defer(self.migrate_all, batch_size, items[batch_size:])
   else:
     logging.warn("Migration finished; starting rebuild.")
     regen = post_deploy.PostRegenerator()
     deferred.defer(regen.regenerate)
예제 #2
0
 def migrate_all(self, batch_size=20, start_key=None):
   q = BloogBreakingMigration.Article.all()
   if start_key:
     q.filter('__key__ >', start_key)
   articles = q.fetch(batch_size)
   for article in articles:
     self.migrate_one(article)
   if len(articles) == batch_size:
     deferred.defer(self.migrate_all, batch_size, articles[-1].key())
   else:
     logging.warn("Migration finished; starting rebuild.")
     regen = post_deploy.PostRegenerator()
     deferred.defer(regen.regenerate)
예제 #3
0
파일: handlers.py 프로젝트: ydxt25/bloggart
 def post(self):
     deferred.defer(post_deploy.PostRegenerator().regenerate)
     deferred.defer(post_deploy.PageRegenerator().regenerate)
     deferred.defer(post_deploy.try_post_deploy, force=True)
     self.render_to_response("regenerating.html")
예제 #4
0
 def post(self):
     regen = post_deploy.PostRegenerator()
     deferred.defer(regen.regenerate)
     deferred.defer(post_deploy.post_deploy, post_deploy.BLOGGART_VERSION)
     self.render_to_response("regenerating.html")