-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix(device): prevent while true loop high cpu usage bug #298
Conversation
WalkthroughThe changes introduce a modification to the Changes
Possibly related PRs
Suggested reviewers
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #298 +/- ##
==========================================
- Coverage 39.93% 39.93% -0.01%
==========================================
Files 84 84
Lines 7534 7535 +1
==========================================
Hits 3009 3009
- Misses 4525 4526 +1 ☔ View full report in Codecov by Sentry. |
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: 0
Outside diff range and nitpick comments (1)
midealocal/device.py (1)
743-744
: Consider using a shorter delay to balance CPU usage and responsiveness.Adding a
time.sleep(5)
statement within thewhile True
loop is a good approach to prevent high CPU usage. However, a delay of 5 seconds might be too long and could potentially impact the responsiveness of the device.Consider using a shorter delay, such as 0.1 or 0.5 seconds, to strike a balance between reducing CPU usage and maintaining responsiveness.
- time.sleep(5) + time.sleep(0.5) # Adjust the delay as neededCould you please clarify the reasoning behind choosing a 5-second delay? Is there any specific requirement or constraint that led to this choice?
@rokam @chemelli74 please help to review and publish a new release with v3.0.1 for it. once midea-local done, please help to approve/merge below PR: and quickly publish a new release with v0.5.9 |
once it done, please rerun the action job in midea_ac_lan repo, as midea-local v3.0.1 not exist now, so the PR action failed. |
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.
Let's try this.
🤖 I have created a release *beep* *boop* --- ## [3.0.1](v3.0.0...v3.0.1) (2024-09-21) ### Bug Fixes * **device:** prevent while true loop high cpu usage bug ([#298](#298)) ([3bdec5c](3bdec5c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
add a sleep in while true loop and prevent high cpu usage bug
Summary by CodeRabbit