diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-10-31 17:36:41 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-10-31 14:36:41 -0700 |
commit | 23e4b4a27d915191dc4f1164c86e26651b379a11 (patch) | |
tree | 3bf51e73047bae7666ff73e534ccad3140463d24 /api/context.go | |
parent | 709ef99eca0353585eb00c795cc36f39bac29a1f (diff) | |
download | chat-23e4b4a27d915191dc4f1164c86e26651b379a11.tar.gz chat-23e4b4a27d915191dc4f1164c86e26651b379a11.tar.bz2 chat-23e4b4a27d915191dc4f1164c86e26651b379a11.zip |
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
Diffstat (limited to 'api/context.go')
-rw-r--r-- | api/context.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/api/context.go b/api/context.go index fee78dbfd..2842e63a7 100644 --- a/api/context.go +++ b/api/context.go @@ -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) } |