Skip to content

Commit

Permalink
Merge pull request #1462 from BoostryJP/feature/#1461
Browse files Browse the repository at this point in the history
Commit token cache to DB once per token in `Indexer_Token_Detail` batch
  • Loading branch information
YoshihitoAso authored Dec 12, 2023
2 parents 6431f9e + d2b335c commit bb873b9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions batch/indexer_Token_Detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def __sync(self, local_session: Session):
token_detail = token_detail_obj.to_model()
token_detail.created = datetime.utcnow()
local_session.merge(token_detail)
local_session.commit()

# Keep request interval constant to avoid throwing many request to JSON-RPC
elapsed_time = time.time() - start_time
Expand All @@ -135,8 +136,6 @@ def __sync(self, local_session: Session):
"The record may have been deleted in another session during the update"
)

local_session.commit()


def main():
LOG.info("Service started successfully")
Expand Down

0 comments on commit bb873b9

Please sign in to comment.