def delete_invalid_seasons(): for season in EXCLUDED_SEASONS: logger.info( f"Deleting invalid season {season} from [ntx_tenure] table (excluded season)..." ) row = ntx_tenure_row() row.delete(season) logger.info( f"Deleting invalid season {season} from [scoring_epochs] table (excluded season)..." ) row = scoring_epoch_row() row.delete(season) for season in get_notarised_seasons(): if season not in SCORING_EPOCHS and season not in EXCLUDED_SEASONS: logger.info( f"Deleting invalid season {season} from [scoring_epochs] table (not in scoring epochs)..." ) row = scoring_epoch_row() row.delete(season)
if ntx_row.server == "Third_Party": ntx_row.chain == "GLEEC-OLD" if ntx_row.score_value > 0: ntx_row.scored = True else: ntx_row.scored = False ntx_row.update() except Exception as e: logger.error(e) logger.error(f"Something wrong with API? {txid_url}") if __name__ == "__main__": seasons = get_notarised_seasons() for season in seasons: if season not in EXCLUDED_SEASONS: season_notaries = list(NOTARY_PUBKEYS[season].keys()) season_notaries.sort() servers = get_notarised_servers(season) for server in servers: chains = get_notarised_chains(season, server) i = 0 while len(chains) > 0: chain = random.choice(chains) i += 1 logger.info( f">>> Importing {chain} for {season} {server} ({i} processed, {len(chains)} remaining )" )