Loadpoint: add enable/disable delay apis (#16396)

This commit is contained in:
andig 2024-10-03 12:36:39 +02:00 • committed by GitHub
parent 67e5927078
commit 37d1f5861f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 145 additions and 12 deletions

View file

@ -162,6 +162,11 @@ func boolGetHandler(get func() bool) http.HandlerFunc {
}
}
// durationHandler updates duration-param api
func durationHandler(set func(time.Duration) error, get func() time.Duration) http.HandlerFunc {
return handler(util.ParseDuration, set, get)
}
// updateSmartCostLimit sets the smart cost limit globally
func updateSmartCostLimit(site site.API) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {