1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-04 11:44:00 +00:00

Add /hll_force_write

This commit is contained in:
Kane York 2015-12-23 22:18:11 -08:00
parent 81c477cd6b
commit 2ddfa2b02c
2 changed files with 7 additions and 0 deletions

View file

@ -88,6 +88,7 @@ func SetupServerAndHandle(config *ConfigFile, serveMux *http.ServeMux) {
serveMux.Handle("/.well-known/", http.FileServer(http.Dir("/tmp/letsencrypt/"))) serveMux.Handle("/.well-known/", http.FileServer(http.Dir("/tmp/letsencrypt/")))
serveMux.HandleFunc("/stats", HTTPShowStatistics) serveMux.HandleFunc("/stats", HTTPShowStatistics)
serveMux.HandleFunc("/hll/", HTTPShowHLL) serveMux.HandleFunc("/hll/", HTTPShowHLL)
serveMux.HandleFunc("/hll_force_write", HTTPWriteHLL)
serveMux.HandleFunc("/drop_backlog", HTTPBackendDropBacklog) serveMux.HandleFunc("/drop_backlog", HTTPBackendDropBacklog)
serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish) serveMux.HandleFunc("/uncached_pub", HTTPBackendUncachedPublish)

View file

@ -164,6 +164,12 @@ func HTTPShowHLL(w http.ResponseWriter, r *http.Request) {
hllFileServer.ServeHTTP(w, r) 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. // loadUniqueUsers loads the previous HLLs into memory.
// is_init_func // is_init_func
func loadUniqueUsers() { func loadUniqueUsers() {