Skip to content
Snippets Groups Projects
Commit 3f4a2081 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Some indexes has been disabled for initial sync process.

Enabled concurrent flush of Follow objects.
parent 9ffb6da6
No related branches found
No related tags found
1 merge request!121Prerequisuites to Reputation api support
......@@ -97,9 +97,9 @@ class DbState:
'hive_follows_ix5a', # (following, state, created_at, follower)
'hive_follows_ix5b', # (follower, state, created_at, following)
# 'hive_posts_parent_id_idx',
'hive_posts_parent_id_idx',
'hive_posts_depth_idx',
'hive_posts_created_at_idx',
'hive_posts_root_id_id_idx',
'hive_posts_community_id_idx',
......@@ -129,7 +129,9 @@ class DbState:
#'hive_posts_cache_ix33', # API: community payout
#'hive_posts_cache_ix34', # API: community muted
'hive_accounts_ix1', # (cached_at, name)
'hive_accounts_ix5' # (cached_at, name)
'hive_accounts_ix5', # (cached_at, name)
'hive_post_tags_tag_id_idx'
]
to_return = []
......
......@@ -36,6 +36,10 @@ def time_collector(f):
return (result, elapsedTime)
def follows_flush_helper():
folllow_items = len(Follow.follow_items_to_flush) + Follow.flush(trx=False)
return folllow_items
class Blocks:
"""Processes blocks, dispatches work, manages `hive_blocks` table."""
blocks_to_flush = []
......@@ -48,6 +52,7 @@ class Blocks:
('Reputations', Reputations.flush, Reputations),
('Votes', Votes.flush, Votes),
('Tags', Tags.flush, Tags),
('Follow', follows_flush_helper, Follow)
]
def __init__(cls):
......@@ -129,9 +134,6 @@ class Blocks:
log.info("#############################################################################")
flush_time = register_time(flush_time, "Blocks", cls._flush_blocks())
folllow_items = len(Follow.follow_items_to_flush) + Follow.flush(trx=False)
flush_time = register_time(flush_time, "Follow", folllow_items)
DB.query("COMMIT")
completedThreads = 0;
......@@ -198,7 +200,7 @@ class Blocks:
elif op_type == 'effective_comment_vote_operation':
key_vote = "{}/{}/{}".format(op_value['voter'], op_value['author'], op_value['permlink'])
Reputations.process_vote(block_num, op_value)
# Reputations.process_vote(block_num, op_value)
vote_ops[ key_vote ] = op_value
......
......@@ -17,8 +17,6 @@ class Reputations(DbAdapterHolder):
@classmethod
def flush(self):
self._queries.clear()
if not self._queries:
return 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment