def lambda_handler()

in src/upload_to_elasticsearch.py [0:0]


def lambda_handler(event, context):
    # Pull the keywords S3 location for the payload of the previous lambda function
    keywordsS3Location = event["processedTranscription"][0]

    fullEpisodeS3Location = event["processedTranscription"][1]

    index_keywords(es, event, keywordsS3Location)

    index_episode(es, event, fullEpisodeS3Location)
    # Episode level payload

    # If it is not debug mode, then clean up the temp files.
    if isDebugMode != 'TRUE':
        response = s3_client.delete_object(Bucket=event['audioS3Location']['bucket'],
                                           Key=event['audioS3Location']['key'])
        response = s3_client.delete_object(Bucket=keywordsS3Location['bucket'], Key=keywordsS3Location['key'])

    return