Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Merge requests
!121
Prerequisuites to Reputation api support
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Prerequisuites to Reputation api support
reputation_api_support
into
develop
Overview
0
Commits
14
Pipelines
0
Changes
2
Merged
Bartek Wrona
requested to merge
reputation_api_support
into
develop
4 years ago
Overview
0
Commits
14
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
9ffb6da6
Prev
Next
Show latest version
2 files
+
14
−
5
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
9ffb6da6
Enabled concurrent execution of Posts.flush
· 9ffb6da6
Bartek Wrona
authored
4 years ago
hive/indexer/blocks.py
+
6
−
3
Options
@@ -43,6 +43,7 @@ class Blocks:
_current_block_date
=
None
_concurrent_flush
=
[
(
'
Posts
'
,
Posts
.
flush
,
Posts
),
(
'
PostDataCache
'
,
PostDataCache
.
flush
,
PostDataCache
),
(
'
Reputations
'
,
Reputations
.
flush
,
Reputations
),
(
'
Votes
'
,
Votes
.
flush
,
Votes
),
@@ -65,6 +66,7 @@ class Blocks:
Votes
.
setup_db_access
(
sharedDbAdapter
)
Tags
.
setup_db_access
(
sharedDbAdapter
)
Follow
.
setup_db_access
(
sharedDbAdapter
)
Posts
.
setup_db_access
(
sharedDbAdapter
)
@classmethod
def
head_num
(
cls
):
@@ -126,11 +128,12 @@ class Blocks:
log
.
info
(
"
#############################################################################
"
)
flush_time
=
register_time
(
flush_time
,
"
Blocks
"
,
cls
.
_flush_blocks
())
flush_time
=
register_time
(
flush_time
,
"
Posts
"
,
Posts
.
flush
())
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
;
pool
=
ThreadPoolExecutor
(
max_workers
=
len
(
cls
.
_concurrent_flush
))
@@ -155,9 +158,9 @@ class Blocks:
assert
completedThreads
==
len
(
cls
.
_concurrent_flush
)
if
(
not
is_initial_sync
)
and
(
first_block
>
-
1
):
DB
.
query
(
"
START TRANSACTION
"
)
cls
.
on_live_blocks_processed
(
first_block
,
last_num
)
DB
.
query
(
"
COMMIT
"
)
DB
.
query
(
"
COMMIT
"
)
log
.
info
(
f
"
[PROCESS MULTI]
{
len
(
blocks
)
}
blocks in
{
OPSM
.
stop
(
time_start
)
:
.
4
f
}
s
"
)
Loading