Update MySQL handler to add timeout for DNS query failures
Signed-off-by: Michael Irwin <mikesir87@gmail.com> I was helping troubleshoot an issue with someone, who ended up having a typo in their compose file where the MySQL service was using the name "msyql", which obviously causes DNS to fail. But, since the db init doesn't time out, it just looks hung. This fixes that.
This commit is contained in:
Родитель
b4d6426abc
Коммит
8dff10bcaa
|
@ -21,7 +21,12 @@ async function init() {
|
|||
const password = PASSWORD_FILE ? fs.readFileSync(PASSWORD_FILE) : PASSWORD;
|
||||
const database = DB_FILE ? fs.readFileSync(DB_FILE) : DB;
|
||||
|
||||
await waitPort({ host, port : 3306});
|
||||
await waitPort({
|
||||
host,
|
||||
port: 3306,
|
||||
timeout: 10000,
|
||||
waitForDns: true,
|
||||
});
|
||||
|
||||
pool = mysql.createPool({
|
||||
connectionLimit: 5,
|
||||
|
|
Загрузка…
Ссылка в новой задаче