outlet/kafka: rename startScaler to runScaler
Some checks failed
CI / 🤖 Check dependabot status (push) Has been cancelled
CI / 🐧 Test on Linux (${{ github.ref_type == 'tag' }}, misc) (push) Has been cancelled
CI / 🐧 Test on Linux (coverage) (push) Has been cancelled
CI / 🐧 Test on Linux (regular) (push) Has been cancelled
CI / ❄️ Build on Nix (push) Has been cancelled
CI / 🍏 Build and test on macOS (push) Has been cancelled
CI / 🧪 End-to-end testing (push) Has been cancelled
CI / 🔍 Upload code coverage (push) Has been cancelled
CI / 🔬 Test only Go (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 20) (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 22) (push) Has been cancelled
CI / 🔬 Test only JS (${{ needs.dependabot.outputs.package-ecosystem }}, 24) (push) Has been cancelled
CI / ⚖️ Check licenses (push) Has been cancelled
CI / 🐋 Build Docker images (push) Has been cancelled
CI / 🐋 Tag Docker images (push) Has been cancelled
CI / 🚀 Publish release (push) Has been cancelled
Update Nix dependency hashes / Update dependency hashes (push) Has been cancelled

There is not stopScaler and it's not like we can start several of them.
This commit is contained in:
Vincent Bernat
2025-11-06 08:10:50 +01:00
parent 620497ef74
commit 41381336b1
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ func (c *realComponent) Start() error {
// StartWorkers will start the initial workers. This should only be called once. // StartWorkers will start the initial workers. This should only be called once.
func (c *realComponent) StartWorkers(workerBuilder WorkerBuilderFunc) error { func (c *realComponent) StartWorkers(workerBuilder WorkerBuilderFunc) error {
c.workerRequestChan = c.startScaler() c.workerRequestChan = c.runScaler()
c.workerBuilder = workerBuilder c.workerBuilder = workerBuilder
for range c.config.MinWorkers { for range c.config.MinWorkers {
if err := c.startOneWorker(); err != nil { if err := c.startOneWorker(); err != nil {

View File

@@ -76,8 +76,8 @@ func (s *scalerState) nextWorkerCount(request ScaleRequest, minWorkers, maxWorke
return next return next
} }
// startScaler starts the automatic scaling loop // runScaler starts the automatic scaling loop
func (c *realComponent) startScaler() chan<- ScaleRequest { func (c *realComponent) runScaler() chan<- ScaleRequest {
ch := make(chan ScaleRequest, c.config.MaxWorkers) ch := make(chan ScaleRequest, c.config.MaxWorkers)
down := rate.Sometimes{Interval: c.config.WorkerDecreaseRateLimit} down := rate.Sometimes{Interval: c.config.WorkerDecreaseRateLimit}
up := rate.Sometimes{Interval: c.config.WorkerIncreaseRateLimit} up := rate.Sometimes{Interval: c.config.WorkerIncreaseRateLimit}