pull/923/head
Andrey 2023-09-19 17:25:39 +03:00
rodzic a4a1e7833f
commit 17d43d2f3e
1 zmienionych plików z 16 dodań i 0 usunięć

Wyświetl plik

@ -7,6 +7,7 @@ from moonstreamdb.blockchain import AvailableBlockchainType
from web3 import Web3
from web3.middleware import geth_poa_middleware
from .db import deduplicate_records
from ..db import yield_db_session_ctx
from ..settings import (
MOONSTREAM_MOONWORM_TASKS_JOURNAL,
@ -341,6 +342,21 @@ def handle_historical_crawl(args: argparse.Namespace) -> None:
)
def handle_deduplicate(args: argparse.Namespace) -> None:
"""
Deduplicate database records
"""
with yield_db_session_ctx() as db_session:
deduplicate_records(
db_session,
args.blockchain_type,
args.table,
args.label,
args.type,
)
def main() -> None:
parser = argparse.ArgumentParser()
parser.set_defaults(func=lambda _: parser.print_help())