Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adwpc committed Jul 23, 2018
1 parent 141cb60 commit 6e73573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion master.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ func NewMaster() *Master {

func (m *Master) GetWorker(id string) *Worker {
m.mutex.Lock()
defer m.mutex.Unlock()
if m.pool == nil {
m.pool = make(map[string]*Worker)
}
if _, ok := m.pool[id]; !ok {
m.pool[id] = NewWorker(id)
m.pool[id].RegMaster(m)
}
m.mutex.Unlock()

return m.pool[id]
}
Expand Down

0 comments on commit 6e73573

Please sign in to comment.