[go: up one dir, main page]

Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
rpc/manager: set autoStart to true on new install
Browse files Browse the repository at this point in the history
  • Loading branch information
zllovesuki committed Apr 2, 2021
1 parent 00bf605 commit cc9f530
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions rpc/server/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,18 @@ func (m *ManagerServer) Load(v []byte) error {
defer m.mu.Unlock()

if len(v) == 0 {
return nil
}

var autoStart bool
buf := bytes.NewReader(v)
if err := binary.Read(buf, binary.BigEndian, &autoStart); err != nil {
return err
// mainly for new installs
m.autoStart = true
log.Println("[gRPCServer] set autoStart to true on new install")
} else {
var autoStart bool
buf := bytes.NewReader(v)
if err := binary.Read(buf, binary.BigEndian, &autoStart); err != nil {
return err
}
m.autoStart = autoStart
}

m.autoStart = autoStart

go managerOnce.Do(func() {
if !m.autoStart {
log.Println("[gRPCServer] not auto starting controller")
Expand Down

0 comments on commit cc9f530

Please sign in to comment.