mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 14:50:52 +01:00
Merge pull request #1220 from nymkappa/bugfix/fix-duplicate-indexing
Duplicated db blocks insertion attempts are expected
This commit is contained in:
commit
877be47e5b
1 changed files with 6 additions and 2 deletions
|
@ -46,8 +46,12 @@ class BlocksRepository {
|
|||
];
|
||||
|
||||
await connection.query(query, params);
|
||||
} catch (e) {
|
||||
logger.err('$saveBlockInDatabase() error' + (e instanceof Error ? e.message : e));
|
||||
} catch (e: any) {
|
||||
if (e.errno === 1062) { // ER_DUP_ENTRY
|
||||
logger.debug(`$saveBlockInDatabase() - Block ${block.height} has already been indexed, ignoring`);
|
||||
} else {
|
||||
logger.err('$saveBlockInDatabase() error' + (e instanceof Error ? e.message : e));
|
||||
}
|
||||
}
|
||||
|
||||
connection.release();
|
||||
|
|
Loading…
Add table
Reference in a new issue