Skip to content

Commit

Permalink
use ledger timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheo committed Sep 21, 2024
1 parent 6418d57 commit 44ff64e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion indexer_app/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def stellar_event_indexer():
]
)
stellar_events = []
ledger_timestamp = datetime.now()
for event in events.events:
event_name = stellar_sdk.scval.to_native(event.topic[0])
event_value = event.value
Expand All @@ -382,8 +383,9 @@ def stellar_event_indexer():
objs=stellar_events,
ignore_conflicts=True
)
ledger_timestamp = event.ledger_close_at
jobs_logger.info(f"Ingested {len(stellar_events)} Stellar events from ledger {start_sequence} to {events.latest_ledger}...")
update_ledger_sequence(events.latest_ledger, event.ledger_close_at)
update_ledger_sequence(events.latest_ledger, ledger_timestamp)

except Exception as e:
jobs_logger.error(f"Error processing ledger {start_sequence}: {e}")
Expand Down

0 comments on commit 44ff64e

Please sign in to comment.