review: 数据库实例管理调整

This commit is contained in:
meilin.huang
2023-09-05 12:49:12 +08:00
parent baf8053613
commit d0ac7de4cb
16 changed files with 199 additions and 137 deletions

View File

@@ -104,7 +104,7 @@ func (d *mongoAppImpl) GetMongoInst(id uint64) *MongoInstance {
var mongoCliCache = cache.NewTimedCache(consts.MongoConnExpireTime, 5*time.Second).
WithUpdateAccessTime(true).
OnEvicted(func(key any, value any) {
logx.Info("删除mongo连接缓存: id = ", key)
logx.Infof("删除mongo连接缓存: id = %s", key)
value.(*MongoInstance).Close()
})