aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backend/router.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/backend/router.go b/backend/router.go
index e11db94..3928119 100644
--- a/backend/router.go
+++ b/backend/router.go
@@ -124,8 +124,12 @@ func NewRouter(debug bool, cfg *Config, db *sql.DB, assets fs.FS) *chi.Mux {
if strings.HasPrefix(r.RequestURI, "/static") {
return
}
- statusCode := GetStatusCode(ctx)()
logger := GetLogger(ctx)
+ if ctx.Value(loginKey).(bool) {
+ logger.Debug("not updating stats because user is admin logged")
+ return
+ }
+ statusCode := GetStatusCode(ctx)()
if statusCode >= 299 && r.RequestURI != storage.HumanPageLoad {
logger.Debug("not updating stats for status code above 299", "status", statusCode)
return