From 4c849539fc672b72e9e992db017f0bab2106020e Mon Sep 17 00:00:00 2001 From: Juan Font Date: Thu, 12 Aug 2021 21:44:12 +0200 Subject: [PATCH] Expire the ephemeral nodes in the Serve method --- app.go | 1 + cmd/headscale/cli/server.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index 91605c03..c5577917 100644 --- a/app.go +++ b/app.go @@ -165,6 +165,7 @@ func (h *Headscale) Serve() error { var err error go h.watchForKVUpdates(5000) + go h.ExpireEphemeralNodes(5000) if h.cfg.TLSLetsEncryptHostname != "" { if !strings.HasPrefix(h.cfg.ServerURL, "https://") { diff --git a/cmd/headscale/cli/server.go b/cmd/headscale/cli/server.go index 1f8db6a2..6d9ad194 100644 --- a/cmd/headscale/cli/server.go +++ b/cmd/headscale/cli/server.go @@ -21,7 +21,7 @@ var serveCmd = &cobra.Command{ if err != nil { log.Fatalf("Error initializing: %s", err) } - go h.ExpireEphemeralNodes(5000) + err = h.Serve() if err != nil { log.Fatalf("Error initializing: %s", err)