mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-30 00:09:42 +01:00
Send notifications when enabling a route
This commit is contained in:
parent
9c2a630055
commit
a376b697c0
13
routes.go
13
routes.go
@ -45,19 +45,12 @@ func (h *Headscale) EnableNodeRoute(namespace string, nodeName string, routeStr
|
|||||||
m.EnabledRoutes = datatypes.JSON(routes)
|
m.EnabledRoutes = datatypes.JSON(routes)
|
||||||
h.db.Save(&m)
|
h.db.Save(&m)
|
||||||
|
|
||||||
// THIS IS COMPLETELY USELESS.
|
err = h.RequestMapUpdates(m.NamespaceID)
|
||||||
// The peers map is stored in memory in the server process.
|
if err != nil {
|
||||||
// Definitely not accessible from the CLI tool.
|
return nil, err
|
||||||
// We need RPC to the server - or some kind of 'needsUpdate' field in the DB
|
|
||||||
peers, _ := h.getPeers(*m)
|
|
||||||
for _, p := range *peers {
|
|
||||||
if pUp, ok := h.clientsPolling.Load(uint64(p.ID)); ok {
|
|
||||||
pUp.(chan []byte) <- []byte{}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return &rIP, nil
|
return &rIP, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, errors.New("could not find routable range")
|
return nil, errors.New("could not find routable range")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user