Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source-gladly: don't emit a checkpoint with no documents every time #1319

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

williamhbaker
Copy link
Member

@williamhbaker williamhbaker commented Mar 5, 2024

Description:

Only emit an updated checkpoint when there are no documents if the current cursor is sufficiently old. Emitting a checkpoint with no documents will trigger an immediate re-invocation of the incremental task, so it shouldn't be done every time.

Workflow steps:

(How does one use this feature, and how has it changed)

Documentation links affected:

(list any documentation links that you created, or existing ones that you've identified as needing updates, along with a brief description)

Notes for reviewers:

(anything that might help someone review this PR)


This change is Reviewable

Only emit an updated checkpoint when there are no documents if the current cursor is sufficiently
old. Emitting a checkpoint with no documents will trigger an immediate re-invocation of the
incremental task, so it shouldn't be done every time.
Copy link
Member

@jgraettinger jgraettinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -60,6 +60,15 @@ async def fetch_events(
f"not updating cursor since last_ts ({last_ts}) <= log_cursor ({log_cursor})"
)
return
elif last_ts - log_cursor < timedelta(hours=6):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i suspect this control flow could be cleaned up further, but this is correct 🤷

@williamhbaker williamhbaker merged commit 122081f into main Mar 5, 2024
50 of 53 checks passed
@williamhbaker williamhbaker deleted the wb/gladly-spam branch March 5, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants