def handle(self, *args, **options): mtc = get_connection() do_update_assignments = options['do_update_assignments'] while True: if options['reviewable']: logging.info(("Updating Reviewable HITs with " "Assignments: %s") % do_update_assignments) update_reviewable_hits( do_update_assignments=do_update_assignments) else: logging.info(("Updating All HITs with " "Assignments: %s") % do_update_assignments) update_all_hits(do_update_assignments=do_update_assignments) logging.info("Sleeping") if not options['loop']: break time.sleep(SLEEP_TIME)
def handle(self, *args, **options): mtc = get_connection() do_update_assignments = options['do_update_assignments'] while True: if options['reviewable']: logging.info(("Updating Reviewable HITs with " "Assignments: %s") % do_update_assignments) update_reviewable_hits( do_update_assignments=do_update_assignments) else: logging.info(("Updating All HITs with " "Assignments: %s") % do_update_assignments) update_all_hits( do_update_assignments=do_update_assignments) logging.info("Sleeping") if not options['loop']: break time.sleep(SLEEP_TIME)
def poll_all_hits(modeladmin, request, queryset): update_all_hits() messages.info(request, "Poll all HITs finished.")