Skip to content
GitLab
Explore
Sign in
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
Commits
11edd698
Commit
11edd698
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
`effective_comment_vote_operation` can exist without `vote_operation`
parent
14cbe356
No related branches found
No related tags found
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!59
Mt votes fixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hive/indexer/blocks.py
+1
-1
1 addition, 1 deletion
hive/indexer/blocks.py
hive/indexer/votes.py
+6
-11
6 additions, 11 deletions
hive/indexer/votes.py
with
7 additions
and
12 deletions
hive/indexer/blocks.py
+
1
−
1
View file @
11edd698
...
...
@@ -230,7 +230,7 @@ class Blocks:
(
vote_ops
,
comment_payout_ops
)
=
Blocks
.
prepare_vops
(
vops
,
cls
.
_head_block_date
)
for
k
,
v
in
vote_ops
.
items
():
Votes
.
effective_comment_vote_op
(
v
,
cls
.
_head_block_date
)
Votes
.
effective_comment_vote_op
(
k
,
v
,
cls
.
_head_block_date
)
if
comment_payout_ops
:
comment_payout_stats
=
Posts
.
comment_payout_op
(
comment_payout_ops
,
cls
.
_head_block_date
)
...
...
This diff is collapsed.
Click to expand it.
hive/indexer/votes.py
+
6
−
11
View file @
11edd698
...
...
@@ -76,23 +76,18 @@ class Votes:
last_update
=
"
1969-12-31T23:59:59
"
)
@classmethod
def
effective_comment_vote_op
(
cls
,
vop
,
date
):
def
effective_comment_vote_op
(
cls
,
key
,
vop
,
date
):
"""
Process effective_comment_vote_operation
"""
voter
=
vop
[
'
voter
'
]
author
=
vop
[
'
author
'
]
permlink
=
vop
[
'
permlink
'
]
if
(
cls
.
inside_flush
):
log
.
info
(
"
Updating data in
'
_votes_data
'
using effective comment
"
)
raise
"
Fatal error
"
key
=
voter
+
"
/
"
+
author
+
"
/
"
+
permlink
assert
key
in
cls
.
_votes_data
cls
.
_votes_data
[
key
][
"
vote_percent
"
]
=
vop
[
"
vote_percent
"
]
cls
.
_votes_data
[
key
][
"
weight
"
]
=
vop
[
"
weight
"
]
cls
.
_votes_data
[
key
][
"
rshares
"
]
=
vop
[
"
rshares
"
]
cls
.
_votes_data
[
key
][
"
last_update
"
]
=
vop
[
"
last_update
"
]
if
key
in
cls
.
_votes_data
:
cls
.
_votes_data
[
key
][
"
vote_percent
"
]
=
vop
[
"
vote_percent
"
]
cls
.
_votes_data
[
key
][
"
weight
"
]
=
vop
[
"
weight
"
]
cls
.
_votes_data
[
key
][
"
rshares
"
]
=
vop
[
"
rshares
"
]
cls
.
_votes_data
[
key
][
"
last_update
"
]
=
vop
[
"
last_update
"
]
@classmethod
def
flush
(
cls
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment