-
Notifications
You must be signed in to change notification settings - Fork 118
Add option to delay torrent injections #1192
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
base: master
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughAdds a configurable Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| console.print("[bold red]CONFIG ERROR: 'inject_delay' must be >= 0") | ||
| inject_delay = 0 | ||
| if inject_delay > 0: | ||
| if meta["debug"] or inject_delay > 5: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this should always be printed or only if the delay is too long
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/clients.py`:
- Around line 188-225: The inject_delay logic should prefer a tracker-specific
inject_delay even when it is 0 and must convert config values to int before
numeric comparisons; change the code in inject_delay to (1) read the raw tracker
value with something like tracker_inject_delay_raw =
self.config["TRACKERS"].get(tracker, {}).get("inject_delay") and detect presence
with "if 'inject_delay' in self.config['TRACKERS'].get(tracker, {})" so a 0 is
not treated as falsy, (2) choose the raw value = tracker_inject_delay_raw if
present else self.config["DEFAULT"].get("inject_delay"), (3) try to convert that
raw value to int in a try/except and on ValueError/TypeError log the CONFIG
ERROR (using tracker context when appropriate) and set inject_delay = 0, (4)
then perform the numeric checks (inject_delay < 0 and > 0) and await
asyncio.sleep(inject_delay) when > 0; update references to tracker_inject_delay
and inject_delay accordingly in the inject_delay method to ensure comparisons
are always against an int.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.