예제 #1
0
 def _clear_report(self):
     """
     Removes the error report from the db
     :return:
     """
     db = DynamoDBHandler(self.__table_name)
     db.delete_item({'lambda': self.__reporter})
     self._report = None
예제 #2
0
def clear_lambda_running(context,
                         dbname,
                         lambda_suffix=None,
                         dynamodb_handler=None):
    """
    This is a convenience method to clear a lambda from the list of running lambdas
    :param context:
    :param string dbname:
    :param string lambda_suffix: the name of the lambda handler
    :param dynamodb_handler:
    :return:
    """
    if dynamodb_handler:
        db = dynamodb_handler(dbname)
    else:
        db = DynamoDBHandler(dbname)

    lambda_name = context.function_name
    if lambda_suffix:
        lambda_name = '{}.{}'.format(lambda_name, lambda_suffix)

    db.delete_item({"lambda": lambda_name})