-
thinkjs项目运行后redis连接数2000+,经过定位发现是think-redis & think-cache-redis导致,具体如下:
`think-redis`: [此处代码](https://github.com/thinkjs/think-redis/blob/master/index.js#L39)根据config做了一层cache用于连接复用,但`think-cache-…
-
OS Platform: macos catalina 10.15
Node.js Version:12.16.2
ThinkJS Version: 3.2.7
### code
```js
async testAction() {
let model = this.model('address');
await model.transaction(asyn…
-
## DESC
10分钟不用,数据库似乎就断开了,本地电脑和服务上都出现这种现象,做一次查询的时间会超过10秒,但查询过一次以后,查询又很快了,过一段时间不用,又断开了。
用Navicat这个工具连接数据库也是这样,但是Navicat里有个“保持连接”的设置,可以解决这个问题。
那在think-model 里有这样对应的设置吗?让数据库一直保持着连接?
### ENV
…
-
## DESC
我在项目里面建立了一个叫common的文件夹,这里面放入了一些封装的类,但是在控制器里面使用的时候报错。
### ENV
OS Platform: win10 x64 & macOS 10.14.5
Node.js Version: 12.14.0
ThinkJS Version: 3.2.11
### code
src/controller/a…
-
windows下能正常起..linux 安装会提示某个模块太久改名了..直接运行会提示没有es2015模块..但装2015模块会发现好像写法太古旧还是版本太老导致改名..总之就是起不来..
-
## DESC
如果要将应用部署到生产环境下,访问域名是www.a.com/aaa/blog/
blog才是应用的根路径,这个路由要如何去配置呢?
## ENV
Platform:
Node.js Version:
ThinkJS Version:
-
## DESC
### ENV
OS Platform:
Node.js Version:
ThinkJS Version:
### code
```js
// your code here
```
### error message
```
// your error message here
```
### more descrip…
-
## DESC
在while内循环当中执行await异步查询时,await对象没有运行结束就执行下面的代码,导致我的对象取不到返回数据
### ENV
OS Platform:
>>> linux CLI命令行
Node.js Version:
>>> 8.17.0
ThinkJS Version:
>>> 3.0
### code
```js…
-
关系到事务的时候,
不同的模型之间要调用.db()来复用连接,
这个有点繁琐了,能不能默认复用一个链接?
我试过给数据库配置加上
`connectionLimit: 1`
但实际测试好像还是得手动用db()来复用,不然也会卡死。
很多时候,某些操作比较复杂,
所以如果出现这种情况:
controller A 调用service B,控制器A和服务B都要操作模型,
由于thinkj…
-
## DESC
按照issue #841 的方法进行测试的时候,想用supertest模拟请求进行API测试,然后发现虽然think.model有内容,但是think.app却没有按照运行流程所说注入think.app.server,也就没办法构造http请求进行测试。以为是异步的问题,但是使用繁忙等待发现think.app.server一直是undefined。另外,按照这样的方式进行测试,t…