steem_client.py 文件源码

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

项目:hivemind 作者: steemit 项目源码 文件源码
def __exec(self, method, *params):
        time_start = time.perf_counter()
        tries = 0
        while True:
            try:
                result = self._client.exec(method, *params)
                assert result, "empty response {}".format(result)
            except (AssertionError, RPCError) as e:
                tries += 1
                print("{} failure, retry in {}s -- {}".format(method, tries, e))
                time.sleep(tries)
                continue
            break

        batch_size = len(params[0]) if method == 'get_accounts' else 1
        total_time = int((time.perf_counter() - time_start) * 1000)
        ClientStats.log("%s()" % method, total_time, batch_size)
        return result

    # perform batch call (if jussi is enabled, use batches; otherwise, multi)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号