Node.js Postgresql..数据库错误:连接终止
我们正在使用pm2第三方中间件,每天都会使用PostgreSQL终止连接 [2019-07-17 23:52:47.639][ERROR]ccd错误记录器-Postgresql出现问题。。数据库错误:连接已终止Node.js Postgresql..数据库错误:连接终止,node.js,postgresql,angular5,Node.js,Postgresql,Angular5,我们正在使用pm2第三方中间件,每天都会使用PostgreSQL终止连接 [2019-07-17 23:52:47.639][ERROR]ccd错误记录器-Postgresql出现问题。。数据库错误:连接已终止 var connectionString = process.env.DATABASE_URL || 'pg://postgres:root@localhost:5432/13122018'; var pg = require("pg"); var port = process.env
var connectionString = process.env.DATABASE_URL || 'pg://postgres:root@localhost:5432/13122018';
var pg = require("pg");
var port = process.env.LISTEN_PORT || 5000;
var client = new pg.Client(connectionString);
client.connect(function (error) {
if (error) {
ccderrorlogger.error("client Problem with Postgresql" + error);
} else {
uiinfologger.debug("client Connected with Database");
}
});
如果你收到
“连接已终止”
如果出现错误,那么您的代码中可能有一个关闭池连接的.end()
。如果您正在接收
“连接已终止”
如果出现错误,那么您的代码中可能还有一个关闭池连接的.end()