mirror of
https://github.com/juanfont/headscale.git
synced 2025-01-31 23:01:23 +09:00
Preload namespace
This commit is contained in:
parent
b02a9f9769
commit
c9a411e341
1 changed files with 1 additions and 1 deletions
|
@ -63,7 +63,7 @@ func (h *Headscale) getDirectPeers(m *Machine) (Machines, error) {
|
|||
Msg("Finding direct peers")
|
||||
|
||||
machines := Machines{}
|
||||
if err := h.db.Where("namespace_id = ? AND machine_key <> ? AND registered",
|
||||
if err := h.db.Preload("Namespace").Where("namespace_id = ? AND machine_key <> ? AND registered",
|
||||
m.NamespaceID, m.MachineKey).Find(&machines).Error; err != nil {
|
||||
log.Error().Err(err).Msg("Error accessing db")
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue