summaryrefslogtreecommitdiffstats
path: root/api/context.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-10-31 17:36:41 -0400
committerChristopher Speller <crspeller@gmail.com>2017-10-31 14:36:41 -0700
commit23e4b4a27d915191dc4f1164c86e26651b379a11 (patch)
tree3bf51e73047bae7666ff73e534ccad3140463d24 /api/context.go
parent709ef99eca0353585eb00c795cc36f39bac29a1f (diff)
downloadchat-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.go5
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)
}