server.py 文件源码

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

项目:zeus 作者: getsentry 项目源码 文件源码
def worker(channel, queue, token, repo_ids=None, build_ids=None):
    allowed_repo_ids = frozenset(token['repo_ids'])

    while (await channel.wait_message()):
        msg = await channel.get_json()
        data = msg.get('data')
        if data['repository']['id'] not in allowed_repo_ids:
            continue
        if build_ids and data['id'] not in build_ids:
            continue
        if repo_ids and data['repository']['id'] not in repo_ids:
            continue
        evt = Event(
            msg.get('id'),
            msg.get('event'),
            data,
        )
        await queue.put(evt)
        current_app.logger.debug(
            'pubsub.event.received qsize=%s', queue.qsize())


# @log_errors
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号