From 27c97f599a95c63a383c1480e620b112bcd357db Mon Sep 17 00:00:00 2001 From: mtrela <mtrela@syncad.com> Date: Fri, 4 Sep 2020 15:58:03 +0200 Subject: [PATCH] A call `get_accounts` is removed --- hive/server/condenser_api/cursor.py | 36 ---------------------------- hive/server/condenser_api/methods.py | 8 ------- hive/server/serve.py | 1 - hive/steem/http_client.py | 1 - hive/utils/stats.py | 1 - 5 files changed, 47 deletions(-) diff --git a/hive/server/condenser_api/cursor.py b/hive/server/condenser_api/cursor.py index bdc99b0df..3020a765f 100644 --- a/hive/server/condenser_api/cursor.py +++ b/hive/server/condenser_api/cursor.py @@ -433,39 +433,3 @@ async def pids_by_replies_to_account(db, start_author: str, start_permlink: str """ % seek return await db.query_col(sql, parent=parent_account, start_id=start_id, limit=limit) - -async def get_accounts(db, accounts: list): - """Returns accounts data for accounts given in list""" - ret = [] - - names = ["'{}'".format(a) for a in accounts] - sql = """SELECT * - FROM hive_accounts_info_view WHERE name IN ({})""".format(",".join(names)) - - result = await db.query_all(sql) - for row in result: - account_data = {} - if not row.raw_json is None and row.raw_json != '': - account_data = dict(loads(row.raw_json)) - account_data['created_at'] = row.created_at.isoformat() - account_data['reputation'] = row.reputation - account_data['display_name'] = row.display_name - account_data['about'] = row.about - account_data['location'] = row.location - account_data['website'] = row.website - account_data['profile_image'] = row.profile_image - account_data['cover_image'] = row.cover_image - account_data['followers'] = row.followers - account_data['following'] = row.following - account_data['proxy'] = row.proxy - account_data['post_count'] = row.post_count - account_data['proxy_weight'] = row.proxy_weight - account_data['rank'] = row.rank - account_data['lastread_at'] = row.lastread_at.isoformat() - - account_data['active_at'] = row.active_at.isoformat() - - account_data['cached_at'] = row.cached_at.isoformat() - ret.append(account_data) - - return ret diff --git a/hive/server/condenser_api/methods.py b/hive/server/condenser_api/methods.py index bf3375c65..311825a6c 100644 --- a/hive/server/condenser_api/methods.py +++ b/hive/server/condenser_api/methods.py @@ -577,14 +577,6 @@ async def _get_blog(db, account: str, start_index: int, limit: int = None): return out -@return_error_info -async def get_accounts(context, accounts: list): - """Returns accounts data for accounts given in list""" - assert accounts, "Empty parameters are not supported" - assert len(accounts) < 1000, "Query exceeds limit" - - return await cursor.get_accounts(context['db'], accounts) - @return_error_info async def get_active_votes(context, author: str, permlink: str): """ Returns all votes for the given post. """ diff --git a/hive/server/serve.py b/hive/server/serve.py index f0f233d7b..5bbdcb036 100644 --- a/hive/server/serve.py +++ b/hive/server/serve.py @@ -90,7 +90,6 @@ def build_methods(): condenser_api.get_blog_entries, condenser_api.get_account_reputations, condenser_api.get_reblogged_by, - condenser_api.get_accounts, condenser_api.get_active_votes )}) diff --git a/hive/steem/http_client.py b/hive/steem/http_client.py index 0058ab354..5e902b6a6 100644 --- a/hive/steem/http_client.py +++ b/hive/steem/http_client.py @@ -84,7 +84,6 @@ class HttpClient(object): METHOD_API = dict( lookup_accounts='condenser_api', get_block='block_api', - get_accounts='condenser_api', get_order_book='condenser_api', get_feed_history='database_api', get_dynamic_global_properties='database_api', diff --git a/hive/utils/stats.py b/hive/utils/stats.py index 6143708c7..e37daa480 100644 --- a/hive/utils/stats.py +++ b/hive/utils/stats.py @@ -419,7 +419,6 @@ class SteemStats(StatsAbstract): 'get_dynamic_global_properties': 20, 'get_block': 50, 'get_blocks_batch': 5, - 'get_accounts': 3, 'get_content': 4, 'get_order_book': 20, 'get_feed_history': 20, -- GitLab