Esempio 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)
Esempio 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)
Esempio n. 3
0
def poll_all_hits(modeladmin, request, queryset):
    update_all_hits()
    messages.info(request, "Poll all HITs finished.")