Skip to content

Add rate limiting for task updates #35

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

Merged
merged 4 commits into from
Mar 3, 2025
Merged

Add rate limiting for task updates #35

merged 4 commits into from
Mar 3, 2025

Conversation

snopoke
Copy link
Collaborator

@snopoke snopoke commented Mar 3, 2025

Summary

  • Add rate limiting capabilities for task progress updates based on time and value intervals
  • Allow specifying minimum ping intervals to reduce update frequency
  • Optimize API usage by preventing unnecessary updates
  • Fix datetime deprecation warnings

Test plan

  • Added comprehensive tests for time and value interval checks
  • Verified both progress update methods respect interval settings
  • Confirmed ping intervals work correctly with the time-based checks

🤖 Generated with Claude Code

@snopoke snopoke requested a review from Copilot March 3, 2025 15:48
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR adds rate limiting capabilities to task updates by introducing time‐ and value‐based interval checks along with configurable ping intervals to optimize API usage and reduce unnecessary updates.

  • Added tests for rate limiting using time and value intervals as well as combined checks.
  • Updated the Task API methods (increment_progress, update_progress, ping) to respect new interval parameters.
  • Revised test utilities to use full datetime import for consistency.

Reviewed Changes

File Description
tests/test_sdk.py Added tests for new rate limiting functionality on task updates.
taskbadger/sdk.py Updated task update methods to include configurable intervals.
tests/utils.py Modified datetime usage to match the new import style.

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@snopoke snopoke merged commit 0337e12 into main Mar 3, 2025
5 checks passed
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.

None yet

1 participant