Remove superfluous test support code. Fix bug in node list cli command.

Add tests.
This commit is contained in:
Ward Vandewege 2021-05-23 09:55:15 -04:00
parent 6a3b171e99
commit d1c3faae5f
4 changed files with 42 additions and 7 deletions

5
app.go
View file

@ -100,11 +100,6 @@ func (h *Headscale) redirect(w http.ResponseWriter, req *http.Request) {
// ExpireEphemeralNodes deletes ephemeral machine records that have not been
// seen for longer than h.cfg.EphemeralNodeInactivityTimeout
func (h *Headscale) ExpireEphemeralNodes(milliSeconds int64) {
if milliSeconds == 0 {
// For testing
h.expireEphemeralNodesWorker()
return
}
ticker := time.NewTicker(time.Duration(milliSeconds) * time.Millisecond)
for range ticker.C {
h.expireEphemeralNodesWorker()