mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-26 22:25:52 -05:00
Expire ephemeral is internal
This commit is contained in:
parent
4c849539fc
commit
c1e6157847
6
app.go
6
app.go
@ -107,9 +107,9 @@ func (h *Headscale) redirect(w http.ResponseWriter, req *http.Request) {
|
|||||||
http.Redirect(w, req, target, http.StatusFound)
|
http.Redirect(w, req, target, http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExpireEphemeralNodes deletes ephemeral machine records that have not been
|
// expireEphemeralNodes deletes ephemeral machine records that have not been
|
||||||
// seen for longer than h.cfg.EphemeralNodeInactivityTimeout
|
// seen for longer than h.cfg.EphemeralNodeInactivityTimeout
|
||||||
func (h *Headscale) ExpireEphemeralNodes(milliSeconds int64) {
|
func (h *Headscale) expireEphemeralNodes(milliSeconds int64) {
|
||||||
ticker := time.NewTicker(time.Duration(milliSeconds) * time.Millisecond)
|
ticker := time.NewTicker(time.Duration(milliSeconds) * time.Millisecond)
|
||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
h.expireEphemeralNodesWorker()
|
h.expireEphemeralNodesWorker()
|
||||||
@ -165,7 +165,7 @@ func (h *Headscale) Serve() error {
|
|||||||
var err error
|
var err error
|
||||||
|
|
||||||
go h.watchForKVUpdates(5000)
|
go h.watchForKVUpdates(5000)
|
||||||
go h.ExpireEphemeralNodes(5000)
|
go h.expireEphemeralNodes(5000)
|
||||||
|
|
||||||
if h.cfg.TLSLetsEncryptHostname != "" {
|
if h.cfg.TLSLetsEncryptHostname != "" {
|
||||||
if !strings.HasPrefix(h.cfg.ServerURL, "https://") {
|
if !strings.HasPrefix(h.cfg.ServerURL, "https://") {
|
||||||
|
Loading…
Reference in New Issue
Block a user