INNER CODE UNIT · Python

delta_hours_sec

aws-samples/aws-health-aware · handler.py:492

    delta_hours_sec = delta_hours * 3600

    # formatting time in seconds
    srt_ddb_format_full = "%Y-%m-%d %H:%M:%S"
    str_ddb_format_sec = "%s"
    sec_now = datetime.strftime(datetime.now(), str_ddb_format_sec)

    # check if event arn already exists
    try:
        response = aha_ddb_table.get_item(Key={"arn": event_arn})
    except ClientError as e:
        print(e.response["Error"]["Message"])
    else:
        is_item_response = response.get("Item")
        if is_item_response == None:
            print(datetime.now().strftime(srt_ddb_format_full) + ": record not found")
            # write to dynamodb
            response = aha_ddb_table.put_item(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…