-
Notifications
You must be signed in to change notification settings - Fork 4
fix(ext/sse): use time.Sleep instead of time.NewTicker to fix cpu issue #79
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR refactors the SSE server’s health-check loop to use time.Sleep instead of a ticker (reducing CPU usage), adds a configurable client timeout, and cleans up server initialization and imports. Class diagram for updated Server struct and KeepAlive methodclassDiagram
class Server {
+map[string]*Client clients
+map[string]int conns
+context.Context ctx
+context.CancelFunc cancel
+time.Duration clientTimeout
+KeepAlive()
}
class Client
Server --> Client : manages
Class diagram for Option type and usageclassDiagram
class Option {
<<function>>
+apply(*Server)
}
Option --> Server : modifies
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Here's the code health analysis summary for commits Analysis Summary
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #79 +/- ##
=======================================
Coverage ? 91.70%
=======================================
Files ? 66
Lines ? 2675
Branches ? 0
=======================================
Hits ? 2453
Misses ? 192
Partials ? 30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Changed
Fixed
Added
Tests
Tasks to complete before merging PR:
make unit-tests
to check for any regressions 📋make lint
to check for any issuesSummary by Sourcery
Use time.Sleep instead of a time.Ticker for the SSE server health check to fix CPU usage, introduce a configurable ClientTimeout, and rename/refactor the health check method and constructor.
New Features:
Bug Fixes:
Enhancements:
Chores: