invalidroutesreporter.py 文件源码

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

项目:invalidroutesreporter 作者: pierky 项目源码 文件源码
def process_alert(self, route):
        recipients = list(set(route["recipient_ids"]))

        logging.debug("Processing alert for {}, recipients {}".format(
            str(route), str(recipients)
        ))

        if "*" in self.data:
            recipients.append("*")

        for recipient_id in recipients:
            if not recipient_id in self.data:
                continue

            recipient = self.data[recipient_id]

            if len(recipient["routes"]) < recipient["config"]["max_routes"]:
                recipient["routes"].append(route)
            else:
                logging.debug("Discarding route {} for {}: buffer full ".format(
                    route["prefix"], recipient_id
                ))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号