forked from hswaw/hscloud
go/svc/leasifier: sort returned leases
This commit is contained in:
parent
a9a266c08c
commit
208f005830
1 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"io"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -164,6 +165,7 @@ func (s *service) work(ctx context.Context) {
|
|||
glog.Errorf("Could not parse lease file: %v", err)
|
||||
return
|
||||
}
|
||||
sort.Slice(l, func(i, j int) bool { return string([]byte(l[i].ip)) < string([]byte(l[j].ip)) })
|
||||
leases = l
|
||||
glog.Infof("Got %d leases", len(leases))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue