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
Этот коммит содержится в:
Joram Wilander
2017-10-31 17:36:41 -04:00
коммит произвёл Christopher Speller
родитель 709ef99eca
Коммит 23e4b4a27d
3 изменённых файлов: 11 добавлений и 0 удалений

Просмотреть файл

@@ -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)
}