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
Commits
ae5a400b
Commit
ae5a400b
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
Votes are processed correctly
parent
fafb27a3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!68
Fixed result of inaccurate assumption
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hive/indexer/blocks.py
+1
-1
1 addition, 1 deletion
hive/indexer/blocks.py
hive/indexer/posts.py
+0
-4
0 additions, 4 deletions
hive/indexer/posts.py
hive/indexer/votes.py
+8
-7
8 additions, 7 deletions
hive/indexer/votes.py
with
9 additions
and
12 deletions
hive/indexer/blocks.py
+
1
−
1
View file @
ae5a400b
...
...
@@ -207,7 +207,7 @@ class Blocks:
if
not
is_initial_sync
:
Accounts
.
dirty
(
op
[
'
author
'
])
# lite - rep
Accounts
.
dirty
(
op
[
'
voter
'
])
# lite - stats
Votes
.
vote_op
(
op
)
Votes
.
vote_op
(
op
,
cls
.
_head_block_date
)
# misc ops
elif
op_type
==
'
transfer_operation
'
:
...
...
This diff is collapsed.
Click to expand it.
hive/indexer/posts.py
+
0
−
4
View file @
ae5a400b
...
...
@@ -161,7 +161,6 @@ class Posts:
payout = COALESCE( CAST( data_source.payout as DECIMAL ), ihp.payout ),
pending_payout = COALESCE( CAST( data_source.pending_payout as DECIMAL ), ihp.pending_payout ),
payout_at = COALESCE( CAST( data_source.payout_at as TIMESTAMP ), ihp.payout_at ),
updated_at = data_source.updated_at,
last_payout = COALESCE( CAST( data_source.last_payout as TIMESTAMP ), ihp.last_payout ),
cashout_time = COALESCE( CAST( data_source.cashout_time as TIMESTAMP ), ihp.cashout_time ),
is_paidout = COALESCE( CAST( data_source.is_paidout as BOOLEAN ), ihp.is_paidout )
...
...
@@ -177,7 +176,6 @@ class Posts:
t.payout,
t.pending_payout,
t.payout_at,
t.updated_at,
t.last_payout,
t.cashout_time,
t.is_paidout
...
...
@@ -196,7 +194,6 @@ class Posts:
payout,
pending_payout,
payout_at,
updated_at,
last_payout,
cashout_time,
is_paidout)
...
...
@@ -323,7 +320,6 @@ class Posts:
"
NULL
"
if
(
pending_payout
is
None
)
else
pending_payout
,
"
NULL
"
if
(
payout_at
is
None
)
else
(
"'
{}
'
::timestamp
"
.
format
(
payout_at
)
),
date
,
#updated_at
"
NULL
"
if
(
last_payout
is
None
)
else
(
"'
{}
'
::timestamp
"
.
format
(
last_payout
)
),
"
NULL
"
if
(
cashout_time
is
None
)
else
(
"'
{}
'
::timestamp
"
.
format
(
cashout_time
)
),
...
...
This diff is collapsed.
Click to expand it.
hive/indexer/votes.py
+
8
−
7
View file @
ae5a400b
...
...
@@ -49,11 +49,12 @@ class Votes:
inside_flush
=
False
@classmethod
def
vote_op
(
cls
,
vo
p
):
def
vote_op
(
cls
,
vo
te_operation
,
date
):
"""
Process vote_operation
"""
voter
=
vop
[
'
voter
'
]
author
=
vop
[
'
author
'
]
permlink
=
vop
[
'
permlink
'
]
voter
=
vote_operation
[
'
voter
'
]
author
=
vote_operation
[
'
author
'
]
permlink
=
vote_operation
[
'
permlink
'
]
weight
=
vote_operation
[
'
weight
'
]
if
(
cls
.
inside_flush
):
log
.
info
(
"
Adding new vote-info into
'
_votes_data
'
dict
"
)
...
...
@@ -64,10 +65,10 @@ class Votes:
cls
.
_votes_data
[
key
]
=
dict
(
voter
=
voter
,
author
=
author
,
permlink
=
permlink
,
vote_percent
=
0
,
vote_percent
=
weight
,
weight
=
0
,
rshares
=
0
,
last_update
=
"
1969-12-31T23:59:59
"
)
last_update
=
date
)
@classmethod
def
effective_comment_vote_op
(
cls
,
key
,
vop
,
date
):
...
...
@@ -79,7 +80,6 @@ class Votes:
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
"
]
=
date
...
...
@@ -106,6 +106,7 @@ class Votes:
INNER JOIN hive_accounts ha_a ON ha_a.name = t.author
INNER JOIN hive_permlink_data hpd_p ON hpd_p.permlink = t.permlink
INNER JOIN hive_posts hp ON hp.author_id = ha_a.id AND hp.permlink_id = hpd_p.id
WHERE NOT hp.is_paidout
) as data_source(post_id, voter_id, author_id, permlink_id, weight, rshares, vote_percent, last_update)
ON CONFLICT ON CONSTRAINT hive_votes_ux1 DO
UPDATE
...
...
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