Dont update metrics when none are enabled
the build was successful Details

This commit is contained in:
kolaente 2018-12-12 12:32:16 +01:00
parent 610280c5e8
commit ae7732bfa0
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 0 deletions

View File

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