Skip to content

Commit

Permalink
Remove useless variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gnutix committed Nov 8, 2023
1 parent 0dd8a09 commit e6437a9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,18 +317,16 @@ func (s *Scheduler) resizePool() {
)

var delay, wait time.Duration
var now time.Time

for i := 0; i < nodesToCreate; i++ {
// Skip the delay for the first node ever we create
if len(s.nodes) > 0 || i > 0 {
delay = s.config.ProvisioningDelay
}

now = time.Now()
s.earliestNextNodeProvisioning = lo.Must(lo.Coalesce(s.earliestNextNodeProvisioning, now)).Add(delay)
queueNode := now.Before(s.earliestNextNodeProvisioning)
wait = s.earliestNextNodeProvisioning.Sub(now) + (2 * time.Second)
s.earliestNextNodeProvisioning = lo.Must(lo.Coalesce(s.earliestNextNodeProvisioning, time.Now())).Add(delay)
queueNode := time.Now().Before(s.earliestNextNodeProvisioning)
wait = s.earliestNextNodeProvisioning.Sub(time.Now()) + (2 * time.Second)

nodeName := namegen.Get()
nodeState := &nodeState{
Expand Down

0 comments on commit e6437a9

Please sign in to comment.