Scala slick 有超时设置吗? [英] Does Scala slick have timeout setting?
问题描述
我在 Play 中注意到了!我可以在 application.conf 中放入几个设置来指定连接超时.自从玩!直接利用 Scala slick,我认为 Scala slick 中也应该有类似的设置,但是到目前为止我找不到任何参考.如果它尚不可用,我会感到惊讶.
I noticed in Play! there are couple of settings I can put in application.conf to specify the connection timeout. Since Play! directly leverages Scala slick, I thought there should be similar settings in Scala slick as well, however I cannot find any reference for it so far. I would be surprised if it is unavailable yet.
推荐答案
IIRC 您使用 Play 设置配置连接池.如果您将 Slick 与连接池 (Database.fromDataSource
) 一起使用,您可以在连接池中配置超时.没什么特别的.
IIRC you configure the connection pool with the Play settings. If you use Slick with a connection pool (Database.fromDataSource
) you can configure the timeout in the connection pool. It's nothing Slick specific.
这篇关于Scala slick 有超时设置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!