Пример #1
0
def refresh():
    """Update incremental aggregates and materialized views, then email logs
    to the development team.
    """
    buffer = io.StringIO()
    with mail.CaptureLogs(manage.logger, buffer):
        try:
            manage.update_aggregates()
            manage.refresh_materialized()
            download.clear_bucket()
        except Exception as error:
            manage.logger.exception(error)
    try:
        mail.send_mail(buffer)
    except Exception as error:
        logger.exception(error)
Пример #2
0
def refresh():
    """Update incremental aggregates and materialized views, then email logs
    to the development team.
    """
    buffer = io.StringIO()
    with mail.CaptureLogs(manage.logger, buffer):
        try:
            manage.update_aggregates()
            manage.refresh_materialized()
            download.clear_bucket()
        except Exception as error:
            manage.logger.exception(error)
    try:
        mail.send_mail(buffer)
    except Exception as error:
        logger.exception(error)
Пример #3
0
def refresh_materialized_views():
    """Update incremental aggregates, itemized schedules, materialized views,
    then slack a notification to the development team.
    """
    manage.logger.info('Starting nightly refresh...')
    try:
        manage.refresh_materialized()
        download.clear_bucket()
        slack_message = '*Success* nightly updates for {0} completed'.format(
            get_app_name())
        utils.post_to_slack(slack_message, '#bots')
        manage.logger.info(slack_message)
    except Exception as error:
        manage.logger.exception(error)
        slack_message = '*ERROR* nightly update failed for {0}. Check logs.'.format(
            get_app_name())
        utils.post_to_slack(slack_message, '#bots')
Пример #4
0
def refresh():
    """Update incremental aggregates, itemized schedules, materialized views,
    then slack a notification to the development team.
    """
    manage.logger.info('Starting nightly refresh...')
    try:
        manage.refresh_itemized()
        manage.refresh_materialized()
        download.clear_bucket()
        slack_message = '*Success* nightly updates for {0} completed'.format(env.get_credential('NEW_RELIC_APP_NAME'))
        utils.post_to_slack(slack_message, '#bots')
        manage.logger.info(slack_message)
    except Exception as error:
        manage.logger.exception(error)
        slack_message = '*ERROR* nightly update failed for {0}. Check logs.'.format(env.get_credential('NEW_RELIC_APP_NAME'))
        utils.post_to_slack(slack_message, '#bots')
        manage.logger.exception(error)
Пример #5
0
def refresh():
    """Update incremental aggregates and materialized views, then email logs
    to the development team.
    """
    buffer = io.StringIO()
    with mail.CaptureLogs(manage.logger, buffer):
        try:
            manage.update_aggregates()
            manage.refresh_materialized()
            download.clear_bucket()
            legal_docs.index_advisory_opinions()
            legal_docs.load_advisory_opinions_into_s3()
            # TODO: needs to work with celery
            # legal_docs.load_current_murs()
        except Exception as error:
            manage.logger.exception(error)
    try:
        mail.send_mail(buffer)
    except Exception as error:
        logger.exception(error)