Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

请问在多数据库实例下如何设置acquireConnectionTimeout? #23

Closed
Wand3ring opened this issue Mar 18, 2019 · 3 comments
Closed

Comments

@Wand3ring
Copy link

在多数据库实例下,acquireConnectionTimeout如何设置?
如下为配置文件:
// Edit config.default.js
exports.knex = {
default: {
acquireConnectionTimeout: 30000,
},
app: true,
agent: false,
};

这样设置后,acquireConnectionTimeout的时间依旧没有生效,是否为我配置错误?感谢!

@Wand3ring
Copy link
Author

粗暴的解决方式:
在node_moduel中将knex默认的15000值调整即可。
不过该方法并不优雅。

@sunfuze
Copy link
Owner

sunfuze commented Mar 18, 2019

@weiyibo-passion 写到 default 里没有问题啊,你可以在通过 ctx.app.knex.get('${dbname}').client.config 拿到配置。我试过了是没有问题的。

@sunfuze sunfuze closed this as completed Mar 18, 2019
@Wand3ring
Copy link
Author

@weiyibo-passion 写到 default 里没有问题啊,你可以在通过 ctx.app.knex.get('${dbname}').client.config 拿到配置。我试过了是没有问题的。
Hi,感谢您的回复。我后面试了一下,config里面可以拿到配置。只不过mssql没能正确获取对应的配置文件信息。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants