start_pokealarm.py 文件源码

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

项目:PokeAlarm 作者: PokeAlarm 项目源码 文件源码
def accept_webhook():
    try:
        log.debug("POST request received from {}.".format(request.remote_addr))
        data = json.loads(request.data)
        if type(data) == dict: # older webhook style
            data_queue.put(data)
        else:   # For RM's frame
            for frame in data:
                data_queue.put(frame)
    except Exception as e:
        log.error("Encountered error while receiving webhook ({}: {})".format(type(e).__name__, e))
        abort(400)
    return "OK"  # request ok


# Thread used to distribute the data into various processes (for RocketMap format)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号