Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion update_utils/update_goldsky.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def scrape(at_once=1000):
print(f"Saving columns: {COLUMNS_TO_SAVE}")

while True:
# Capture sticky state at start of loop to determine exit condition later
is_sticky_query = sticky_timestamp is not None

# Build the where clause based on cursor state
if sticky_timestamp is not None:
# We're in sticky mode: stay at this timestamp and paginate by id
Expand Down Expand Up @@ -218,7 +221,7 @@ def scrape(at_once=1000):
# Save cursor state for efficient resume (no duplicates on restart)
save_cursor(last_timestamp, last_id, sticky_timestamp)

if len(df) < at_once and sticky_timestamp is None:
if len(df) < at_once and not is_sticky_query:
break

# Clear cursor file on successful completion
Expand Down