Skip to content

Commit

Permalink
Always lock when getting workers (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi authored May 22, 2024
1 parent a22bcc9 commit 48c2ac5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pkg/repository/worker_redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (r *WorkerRedisRepository) GetAllWorkers() ([]*types.Worker, error) {
}

func (r *WorkerRedisRepository) GetAllWorkersInPool(poolName string) ([]*types.Worker, error) {
workers, err := r.getWorkers(false)
workers, err := r.getWorkers(true)
if err != nil {
return nil, err
}
Expand All @@ -241,7 +241,7 @@ func (r *WorkerRedisRepository) GetAllWorkersInPool(poolName string) ([]*types.W
}

func (r *WorkerRedisRepository) GetAllWorkersOnMachine(machineId string) ([]*types.Worker, error) {
workers, err := r.getWorkers(false)
workers, err := r.getWorkers(true)
if err != nil {
return nil, err
}
Expand Down
4 changes: 1 addition & 3 deletions pkg/scheduler/pool_sizing.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package scheduler

import (
"context"
"log"
"time"

"github.com/beam-cloud/beta9/pkg/types"
)

const poolMonitoringInterval = 1 * time.Second
const poolMonitoringInterval = 5 * time.Second

type WorkerPoolSizer struct {
ctx context.Context
controller WorkerPoolController
config *types.WorkerPoolSizingConfig
}
Expand Down

0 comments on commit 48c2ac5

Please sign in to comment.