I am running a GET method of router on NodeJS with Express.js.
I am fetching data from MSSQL but my MSSQL server taking a time and my NodeJS server is not waiting for it more than approximately 15 seconds.
What should i do??
I am running a GET method of router on NodeJS with Express.js.
I am fetching data from MSSQL but my MSSQL server taking a time and my NodeJS server is not waiting for it more than approximately 15 seconds.
What should i do??
You do everything right. But, default timeout in tedious is 15 seconds. Use requestTimeout for
let config = {
user: global.config.database.username,
password: process.env.database_pwd || process.env.DATABASE_PWD,
server: global.config.database.host,
port: 1433,
database: global.config.database.database,
requestTimeout: 180000
};
module.exports.connect = async () => {
pool = await sql.connect(config);
}