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

Настройка размера батчей и внутреннего предела operating_time #246

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

leshchenko1979
Copy link
Owner

@leshchenko1979 leshchenko1979 commented Jul 23, 2024

Fixes #241

Summary by Sourcery

This pull request introduces enhancements to the Bitrix client by allowing configuration of batch size and operating time limit. Documentation has been updated to reflect these new parameters.

  • Enhancements:
    • Added support for configuring batch size and operating time limit in the Bitrix client initialization.
  • Documentation:
    • Updated README.md and API.md to include new parameters for batch size and operating time limit in the Bitrix client initialization.

Copy link

sourcery-ai bot commented Jul 23, 2024

Reviewer's Guide by Sourcery

This pull request addresses issue #241 by introducing new parameters batch_size and operating_time_limit to better manage server load. The changes include updates to the ServerRequestHandler and Bitrix classes to utilize these parameters, as well as corresponding updates to the documentation and example code.

File-Level Changes

Files Changes
fast_bitrix24/srh.py
fast_bitrix24/bitrix.py
fast_bitrix24/mult_request.py
Introduced new parameters batch_size and operating_time_limit to manage server load and updated relevant methods to utilize these parameters.
README.md
API.md
Updated documentation to reflect the new parameters batch_size and operating_time_limit.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @leshchenko1979 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 4 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 5 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

fast_bitrix24/srh.py Show resolved Hide resolved
fast_bitrix24/bitrix.py Show resolved Hide resolved
@@ -35,6 +35,8 @@
respect_velocity_policy: bool = True,
request_pool_size: int = 50,
requests_per_second: float = 2.0,
batch_size: int = 50,
operating_time_limit: int = 480,
Copy link

Choose a reason for hiding this comment

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

suggestion (bug_risk): Consider validating operating_time_limit.

Validating operating_time_limit to ensure it is within a reasonable range can prevent potential issues with request throttling.

Suggested change
operating_time_limit: int = 480,
operating_time_limit: int = 480,
if not (0 < operating_time_limit <= 1440):
raise ValueError("operating_time_limit must be between 1 and 1440 minutes")

fast_bitrix24/bitrix.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
API.md Outdated Show resolved Hide resolved
API.md Show resolved Hide resolved
@leshchenko1979 leshchenko1979 merged commit 11664eb into master Jul 23, 2024
11 checks passed
@leshchenko1979 leshchenko1979 deleted the leshchenko1979/issue241 branch July 23, 2024 19:54
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.

Настройка размера батчей и внутреннего предела operating_time
1 participant