Esempio n. 1
0
    def migrate(self, log_file):
        count = 0
        ids = self.get_couch_ids()
        total_count = len(ids)
        for doc in iter_docs_with_retry(SurveyKeyword.get_db(), ids):
            try:
                couch_obj = SurveyKeyword.wrap(doc)
                couch_obj._migration_do_sync()
            except Exception as e:
                log_file.write('Could not sync SurveyKeyword %s: %s\n' % (doc['_id'], e))

            count += 1
            if (count % 1000) == 0:
                print 'Processed %s / %s documents' % (count, total_count)