services/lambda-mxnet-ci-bot/handler.py [24:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
logging.getLogger().setLevel(logging.INFO)
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger('botocore').setLevel(logging.CRITICAL)

SQS_CLIENT = boto3.client('sqs')


def send_to_sqs(event, context):

    response = (SQS_CLIENT.send_message(
        QueueUrl=os.getenv('SQS_URL'),
        MessageBody=str(event)
    ))

    logging.info('Response: {}'.format(response))
    status = response['ResponseMetadata']['HTTPStatusCode']
    if status == 200:
        logging.info('Enqueued to SQS')
    else:
        logging.error('Unable to enqueue to SQS')

    return {
        "statusCode": status,
        "headers": {"Content-Type": "application/json"}
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



services/lambda-pr-status-labeler/pr_status_bot/handler.py [28:52]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
logging.getLogger().setLevel(logging.INFO)
logging.getLogger('boto3').setLevel(logging.CRITICAL)
logging.getLogger('botocore').setLevel(logging.CRITICAL)

SQS_CLIENT = boto3.client('sqs')


def send_to_sqs(event, context):

    response = (SQS_CLIENT.send_message(
        QueueUrl=os.getenv('SQS_URL'),
        MessageBody=str(event)
    ))

    logging.info('Response: {}'.format(response))
    status = response['ResponseMetadata']['HTTPStatusCode']
    if status == 200:
        logging.info('Enqueued to SQS')
    else:
        logging.error('Unable to enqueue to SQS')

    return {
        "statusCode": status,
        "headers": {"Content-Type": "application/json"}
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



