I'm looking to see how one can set the timeout time of queries in Sequelize.
I've looked into the Sequelize docs for some info but I can't quite find what I'm looking for. The closest I have found is the "pools.acquire" option, but I'm not looking to set the timeout for an incoming connection, but rather the timeout of an ongoing query so that I may short-circuit deadlocks quickly.
http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html
Here is my sample code:
const db = new Sequelize( database, username, password, {
  host   : hostname,
  dialect: "mysql",
  define : {},
  pool: {
    max : 10,
    min : 0,
    idle: 10000
  },
})
Any insight would be greatly appreciated!
add dialectOptions
  const db2 = new Sequelize(database, username, password, {
    host: hostname,
    dialect: "mysql",
    define: {},
    dialectOptions: {
      options: {
        requestTimeout: 3000
      }
    },
    pool: {
      max: 10,
      min: 0,
      idle: 10000
    },
  });
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With