support.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:awslimits 作者: Yipit 项目源码 文件源码
def get_recently_sent_alerts(limits):
    table = create_or_get_table(
        table_name=SENT_ALERTS_TABLE_NAME,
        attribute_definitions=[
            {
                'AttributeName': 'limit_name',
                'AttributeType': 'S',
            },
        ],
        key_schema=[
            {
                'AttributeName': 'limit_name',
                'KeyType': 'HASH'
            },
        ],
    )

    three_days_ago_ts = Decimal((datetime.utcnow() - timedelta(days=3)).strftime('%s'))
    alerts = table.scan(
        FilterExpression=Attr('alert_sent').gt(three_days_ago_ts)
    )['Items']
    return [alert['limit_name'] for alert in alerts]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号