def run_multiprocess_pg_task(info): # print 'mp start ' from Student import Student # import faulthandler # faulthandler.enable() Path.db_setprefix('temp_') Student.db_setprefix('temp_') pg = info['pg'] pg.print_results = False pg.process_tracking = None pg.queue_tracking = info['queue'] pg.count_saved = 0 pg.count_denied = 0 pg.ident = info['ident'] pg.start = info['start'] pg.end = info['end'] logger.info('start %s from: %d to: %d', pg.ident, info['start'], info['end']) pg.run(False) logger.info('ended %s from: %d to: %d', pg.ident, info['start'], info['end']) return pg
def disable_temp_data(): Course.db_setprefix('') Exam.db_setprefix('') ExamInfo.db_setprefix('') Path.db_setprefix('') Student.db_setprefix('') Applicant.db_setprefix('') CourseSemesterInfo.db_setprefix('') MetaData.db_setprefix('')