mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-22 16:07:34 +00:00
adding some sleep on re-registration after machine expired (#1256)
This commit is contained in:
parent
e38efd3cfa
commit
2560c32378
@ -131,11 +131,10 @@ func (h *Headscale) handleRegisterCommon(
|
|||||||
Bool("noise", isNoise).
|
Bool("noise", isNoise).
|
||||||
Msg("Machine is waiting for interactive login")
|
Msg("Machine is waiting for interactive login")
|
||||||
|
|
||||||
ticker := time.NewTicker(registrationHoldoff)
|
|
||||||
select {
|
select {
|
||||||
case <-req.Context().Done():
|
case <-req.Context().Done():
|
||||||
return
|
return
|
||||||
case <-ticker.C:
|
case <-time.After(registrationHoldoff):
|
||||||
h.handleNewMachineCommon(writer, registerRequest, machineKey, isNoise)
|
h.handleNewMachineCommon(writer, registerRequest, machineKey, isNoise)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -265,6 +264,14 @@ func (h *Headscale) handleRegisterCommon(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if registerRequest.Followup != "" {
|
||||||
|
select {
|
||||||
|
case <-req.Context().Done():
|
||||||
|
return
|
||||||
|
case <-time.After(registrationHoldoff):
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The machine has expired or it is logged out
|
// The machine has expired or it is logged out
|
||||||
h.handleMachineExpiredOrLoggedOutCommon(writer, registerRequest, *machine, machineKey, isNoise)
|
h.handleMachineExpiredOrLoggedOutCommon(writer, registerRequest, *machine, machineKey, isNoise)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user