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
2bd91ece
Unverified
Commit
2bd91ece
authored
6 years ago
by
roadscape
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request
#203
from steemit/202-sqlerr
fix fork recovery sql error
parents
cd78b952
4aed9adc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/indexer/blocks.py
+8
-3
8 additions, 3 deletions
hive/indexer/blocks.py
with
8 additions
and
3 deletions
hive/indexer/blocks.py
+
8
−
3
View file @
2bd91ece
...
...
@@ -59,6 +59,7 @@ class Blocks:
@classmethod
def
_process
(
cls
,
block
,
is_initial_sync
=
False
):
"""
Process a single block. Assumes a trx is open.
"""
#pylint: disable=too-many-branches
num
=
cls
.
_push
(
block
)
date
=
block
[
'
timestamp
'
]
...
...
@@ -197,12 +198,16 @@ class Blocks:
post_ids
=
tuple
(
DB
.
query_col
(
sql
,
date
=
date
))
# remove all recent records
DB
.
query
(
"
DELETE FROM hive_posts_cache WHERE post_id IN :ids
"
,
ids
=
post_ids
)
DB
.
query
(
"
DELETE FROM hive_feed_cache WHERE created_at >= :date
"
,
date
=
date
)
DB
.
query
(
"
DELETE FROM hive_reblogs WHERE created_at >= :date
"
,
date
=
date
)
DB
.
query
(
"
DELETE FROM hive_follows WHERE created_at >= :date
"
,
date
=
date
)
#*
DB
.
query
(
"
DELETE FROM hive_post_tags WHERE post_id IN :ids
"
,
ids
=
post_ids
)
DB
.
query
(
"
DELETE FROM hive_posts WHERE id IN :ids
"
,
ids
=
post_ids
)
# remove posts: core, tags, cache entries
if
post_ids
:
DB
.
query
(
"
DELETE FROM hive_posts_cache WHERE post_id IN :ids
"
,
ids
=
post_ids
)
DB
.
query
(
"
DELETE FROM hive_post_tags WHERE post_id IN :ids
"
,
ids
=
post_ids
)
DB
.
query
(
"
DELETE FROM hive_posts WHERE id IN :ids
"
,
ids
=
post_ids
)
DB
.
query
(
"
DELETE FROM hive_payments WHERE block_num = :num
"
,
num
=
num
)
DB
.
query
(
"
DELETE FROM hive_blocks WHERE num = :num
"
,
num
=
num
)
...
...
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