Skip to content

Commit

Permalink
ConfigureDBCache
Browse files Browse the repository at this point in the history
  • Loading branch information
wubin1989 committed Apr 20, 2024
1 parent 5a8b136 commit 83052ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion framework/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ func NewDb(conf config.Config) (db *gorm.DB) {
case DriverPostgres:
collectors = append(collectors, &prometheus.Postgres{})
}
ConfigureMetrics(Db, conf.Db.Prometheus.DBName, uint32(conf.Db.Prometheus.RefreshInterval),
ConfigureMetrics(db, conf.Db.Prometheus.DBName, uint32(conf.Db.Prometheus.RefreshInterval),
nil, collectors...)
}
if conf.Db.Cache.Enable && stringutils.IsNotEmpty(conf.Cache.Stores) {
ConfigureDBCache(db, cache.NewCacheManager(conf))
}
return
}

Expand Down

0 comments on commit 83052ef

Please sign in to comment.