Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
def poll_reviewable_hits(modeladmin, request, queryset):
    update_reviewable_hits()
    messages.info(request, "Poll reviewable HITs finished.")