Exemplo n.º 1
0
    def post(self):
        """This will get hit by taskqueue calls.
        """
        logging.debug('MailChimpUpdater.post hit')

        if not config.MAILCHIMP_ENABLED:
            return

        gapps.process_mailchimp_updates()
Exemplo n.º 2
0
    def get(self):
        """This will get hit by cron triggers.
        """
        logging.debug('MailChimpUpdater.get hit')

        if not config.MAILCHIMP_ENABLED:
            return

        gapps.process_mailchimp_updates()
Exemplo n.º 3
0
    def post(self):
        """This will get hit by taskqueue calls.
        """
        logging.debug('MailChimpUpdater.post hit')

        if not config.MAILCHIMP_ENABLED:
            return

        gapps.process_mailchimp_updates()
Exemplo n.º 4
0
    def get(self):
        """This will get hit by cron triggers.
        """
        logging.debug('MailChimpUpdater.get hit')

        if not config.MAILCHIMP_ENABLED:
            return

        gapps.process_mailchimp_updates()
Exemplo n.º 5
0
def process_mailchimp_updates():
    """Updates MailChimp with changed members and volunteers.
    This gets called both as a cron job and a task queue job.
    """
    if flask.request.method == 'GET':
        # cron job
        logging.debug('tasks.process_mailchimp_updates: hit from cron')
        gapps.validate_cron_task(flask.request)
    else:
        # task queue job
        logging.debug('tasks.process_mailchimp_updates: hit from task queue')
        gapps.validate_queue_task(flask.request)

    if not config.MAILCHIMP_ENABLED:
        return flask.make_response('', 200)

    gapps.process_mailchimp_updates()
    return flask.make_response('', 200)