kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #680 from zomglings/fix-crawler-tx-rollback
Added transaction rollback when there is a violation of unique constraint when crawling blockspull/682/head
commit
a8470441cb
|
@ -215,8 +215,9 @@ def crawl_blocks(
|
|||
|
||||
db_session.commit()
|
||||
except IntegrityError as err:
|
||||
db_session.rollback()
|
||||
assert isinstance(err.orig, UniqueViolation)
|
||||
logger.warning(
|
||||
logger.error(
|
||||
"UniqueViolation error occurred, it means block already exists"
|
||||
)
|
||||
except Exception as err:
|
||||
|
|
|
@ -190,3 +190,6 @@ alembic.docker.ini
|
|||
# Schematic
|
||||
srv/
|
||||
.schematic.env
|
||||
|
||||
# Custom
|
||||
scratch/
|
||||
|
|
Ładowanie…
Reference in New Issue