Skip to content

Commit d405ee4

Browse files
authored
Api: add cache reset (evcc-io#18941)
1 parent 634bc45 commit d405ee4

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+
func resetHandler(w http.ResponseWriter, r *http.Request) {
296+
util.ResetCached()
297+
jsonResult(w, "OK")
298+
}
299+
295300
func logHandler(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)