Skip to content

Commit

Permalink
minor logging tune
Browse files Browse the repository at this point in the history
  • Loading branch information
roadscape committed Feb 5, 2019
1 parent d8eb1cc commit 4b48921
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion hive/indexer/cached_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,15 @@ def _sql(cls, pid, post, level=None):
- `update`: post was modified
- `payout`: post was paidout
- `upvote`: post payout/votes changed
- `recount`: post has new child
"""

#pylint: disable=bad-whitespace
assert post['author'], "post {} is blank".format(pid)

# last-minute sanity check to ensure `pid` is correct #78
pid2 = cls._get_id(post['author']+'/'+post['permlink'])
assert pid == pid2, "hpc id %d maps to %d" % (pid, pid2)
assert pid == pid2, "hpc id %d maps to %d %s" % (pid, pid2, repr(post))

# inserts always sequential. if pid > last_id, this operation
# *must* be an insert; so `level` must not be any form of update.
Expand Down
4 changes: 2 additions & 2 deletions hive/server/condenser_api/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def load_posts(db, ids, truncate_body=0):
# in rare cases of cache inconsistency, recover and warn
missed = set(ids) - posts_by_id.keys()
if missed:
log.warning("get_posts do not exist in cache: %s", repr(missed))
log.info("get_posts do not exist in cache: %s", repr(missed))
for _id in missed:
ids.remove(_id)
sql = ("SELECT id, author, permlink, depth, created_at, is_deleted "
Expand All @@ -70,7 +70,7 @@ async def load_posts(db, ids, truncate_body=0):
VALUES (:id, :author, :permlink)"""
await db.query(sql, **post)
else:
log.warning("requested deleted post: %s", dict(post))
log.info("requested deleted post: %s", dict(post))

return [posts_by_id[_id] for _id in ids]

Expand Down
2 changes: 1 addition & 1 deletion hive/steem/block/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def _check_missing(self, num, prev_date, next_date):
missed = (gap_secs / self.BLOCK_INTERVAL) - 1
if missed:
self._add_missed(missed)
log.warning("%d missed @ block %d", missed, num)
log.info("%d missed @ block %d", missed, num)

def _drift_backward(self, delta=0.1):
"""Delay the schedule by 0.1s when a block fetch failed."""
Expand Down

0 comments on commit 4b48921

Please sign in to comment.