aboutsummaryrefslogtreecommitdiff
path: root/cmd/anubis/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/anubis/main.go')
-rw-r--r--cmd/anubis/main.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go
index a7e7350..4cee20c 100644
--- a/cmd/anubis/main.go
+++ b/cmd/anubis/main.go
@@ -135,6 +135,20 @@ func makeReverseProxy(target string) (http.Handler, error) {
return rp, nil
}
+func startDecayMapCleanup(ctx context.Context, s *libanubis.Server) {
+ ticker := time.NewTicker(1 * time.Hour)
+ defer ticker.Stop()
+
+ for {
+ select {
+ case <-ticker.C:
+ s.CleanupDecayMap()
+ case <-ctx.Done():
+ return
+ }
+ }
+}
+
func main() {
flagenv.Parse()
flag.Parse()
@@ -210,6 +224,8 @@ func main() {
go metricsServer(ctx, wg.Done)
}
+ go startDecayMapCleanup(ctx, s)
+
var h http.Handler
h = s
h = internal.RemoteXRealIP(*useRemoteAddress, *bindNetwork, h)