Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb7b5d6e

Browse files
committed
Api: add cache reset
1 parent2808a29 commitb7b5d6e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

‎server/http.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ func (s *HTTPd) RegisterSystemHandler(valueChan chan<- util.Param, cache *util.P
301301
routes:=map[string]route{
302302
"log": {"GET","/log",logHandler},
303303
"logareas": {"GET","/log/areas",logAreasHandler},
304+
"reset": {"POST","/reset",resetHandler},
304305
"shutdown": {"POST","/shutdown",func(w http.ResponseWriter,r*http.Request) {
305306
shutdown()
306307
w.WriteHeader(http.StatusNoContent)

‎server/http_site_handler.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@ func logAreasHandler(w http.ResponseWriter, r *http.Request) {
292292
jsonResult(w,logstash.Areas())
293293
}
294294

295+
funcresetHandler(w http.ResponseWriter,r*http.Request) {
296+
util.ResetCached()
297+
jsonResult(w,"OK")
298+
}
299+
295300
funclogHandler(w http.ResponseWriter,r*http.Request) {
296301
a:=r.URL.Query()["area"]
297302
l:=logstash.LogLevelToThreshold(r.URL.Query().Get("level"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp