diff --git a/pkg/models/metrics.go b/pkg/models/metrics.go index 3e51143cf..9b66237e6 100644 --- a/pkg/models/metrics.go +++ b/pkg/models/metrics.go @@ -18,6 +18,7 @@ package models import ( "code.vikunja.io/api/pkg/log" + "github.com/spf13/viper" ) // GetListCount returns the current list count from redis @@ -40,6 +41,9 @@ func SetListCount(count int64) error { // UpdateListCount updates the listcount with a given amount func UpdateListCount(update int64) { + if !viper.GetBool("service.emablemetrics") { + return + } oldtotal, err := GetListCount() if err != nil { log.Log.Error(err.Error())