Skip to content
Snippets Groups Projects
Commit 11edd698 authored by Mariusz Trela's avatar Mariusz Trela
Browse files

`effective_comment_vote_operation` can exist without `vote_operation`

parent 14cbe356
No related branches found
No related tags found
4 merge requests!456Release candidate v1 24,!230Setup monitoring with pghero,!135Enable postgres monitoring on CI server,!59Mt votes fixes
......@@ -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)
......
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment