PLT-7810 Track if an APIv3 endpoint was used in the last day (#7744)
* Track if an APIv3 endpoint was used in the last day * Make it atomic
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
709ef99eca
Коммит
23e4b4a27d
@@ -8,6 +8,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
l4g "github.com/alecthomas/log4go"
|
||||
@@ -216,6 +217,10 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
c.CheckTeamId()
|
||||
}
|
||||
|
||||
if h.isApi {
|
||||
atomic.StoreInt32(model.UsedApiV3, 1)
|
||||
}
|
||||
|
||||
if c.Err == nil {
|
||||
h.handleFunc(c, w, r)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user