Skip to content

Commit

Permalink
code review: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Nov 1, 2022
1 parent 22612bd commit 8d35a22
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions nomad/core_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -1184,24 +1184,3 @@ func (c *CoreScheduler) getThreshold(eval *structs.Evaluation, objectName, confi
}
return oldThreshold
}

// getOldestAllocationIndex returns the CreateIndex of the oldest
// non-terminal allocation in the state store
func (c *CoreScheduler) getOldestAllocationIndex() (uint64, error) {
ws := memdb.NewWatchSet()
allocs, err := c.snap.Allocs(ws, state.SortDefault)
if err != nil {
return 0, err
}
for {
raw := allocs.Next()
if raw == nil {
break
}
alloc := raw.(*structs.Allocation)
if !alloc.TerminalStatus() {
return alloc.CreateIndex, nil
}
}
return 0, nil
}

0 comments on commit 8d35a22

Please sign in to comment.