diff --git a/socketserver/server/handlecore.go b/socketserver/server/handlecore.go index 451b9223..49d73c53 100644 --- a/socketserver/server/handlecore.go +++ b/socketserver/server/handlecore.go @@ -88,6 +88,7 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) { serveMux.Handle("/.well-known/", http.FileServer(http.Dir("/tmp/letsencrypt/"))) serveMux.HandleFunc("/stats", HTTPShowStatistics) serveMux.HandleFunc("/hll/", HTTPShowHLL) + serveMux.HandleFunc("/hll_force_write", HTTPWriteHLL) serveMux.HandleFunc("/drop_backlog", HTTPBackendDropBacklog) serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish) diff --git a/socketserver/server/usercount.go b/socketserver/server/usercount.go index 9ac614fa..44ad68e3 100644 --- a/socketserver/server/usercount.go +++ b/socketserver/server/usercount.go @@ -164,6 +164,12 @@ func HTTPShowHLL(w http.ResponseWriter, r *http.Request) { hllFileServer.ServeHTTP(w, r) } +func HTTPWriteHLL(w http.ResponseWriter, r *http.Request) { + writeAllHLLs() + w.WriteHeader(200) + w.Write([]byte("ok")) +} + // loadUniqueUsers loads the previous HLLs into memory. // is_init_func func loadUniqueUsers() {