stub_manager.py 文件源码

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

项目:loopchain 作者: theloopkr 项目源码 文件源码
def __make_stub(self, is_stub_reuse=True):
        if util.datetime_diff_in_mins(self.__stub_update_time) >= conf.STUB_REUSE_TIMEOUT or \
                not is_stub_reuse or self.__stub is None:
            util.logger.spam(f"StubManager:__make_stub is_stub_reuse({is_stub_reuse}) self.__stub({self.__stub})")
            self.__stub = util.get_stub_to_server(self.__target, self.__stub_type, is_check_status=False)
            # if self.__is_secure:
            #     # TODO need treat to secure channel but not yet
            #     channel = grpc.insecure_channel(self.__target)
            # else:
            #     channel = grpc.insecure_channel(self.__target)
            #
            # self.__stub = self.__stub_type(channel)
            self.__stub_update_time = datetime.datetime.now()
        else:
            pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号