diff --git a/lib/router.go b/lib/router.go index 042764d0..3e720274 100644 --- a/lib/router.go +++ b/lib/router.go @@ -238,11 +238,11 @@ func (rt *Router) reloadRoutes(db *mgo.Database, currentOptime bson.MongoTimesta rt.lock.Lock() rt.mux = newmux + routeCount := rt.mux.RouteCount() rt.lock.Unlock() - logInfo(fmt.Sprintf("router: reloaded %d routes", rt.mux.RouteCount())) - - routesCountMetric.Set(float64(rt.mux.RouteCount())) + logInfo(fmt.Sprintf("router: reloaded %d routes", routeCount)) + routesCountMetric.Set(float64(routeCount)) } func (rt *Router) getCurrentMongoInstance(db mongoDatabase) (MongoReplicaSetMember, error) {