web.py 文件源码

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

项目:aws-greengrass-mini-fulfillment 作者: awslabs 项目源码 文件源码
def topic_update(client, userdata, message):
    log.debug('[topic_update] received topic:{0} ts:{1}'.format(
        message.topic, dt.datetime.utcnow()))
    topic_cache[message.topic] = message.payload

    msg = json.loads(message.payload)

    if 'data' in msg:
        global last_hz
        global current_hz
        global current_hz_time
        count_telemetry(msg['data'])
        elapsed = dt.datetime.utcnow() - current_hz_time
        if elapsed > second:  # if a second has passed rollover Hz
            with rollover_lock:
                last_hz = current_hz
                current_hz_time = dt.datetime.utcnow()
                current_hz = 0

    history(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号