Cleanup MySQL unix socket code and add to sample config

This commit is contained in:
wiz
2022-03-14 13:11:04 +00:00
parent 320ce82885
commit d8ac35027e
3 changed files with 8 additions and 6 deletions

View File

@@ -15,10 +15,11 @@ export class DB {
timezone: '+00:00',
}
if (config.DATABASE.SOCKET && config.DATABASE.SOCKET != "")
poolConfig.socketPath = config.DATABASE.SOCKET
else
poolConfig.host = config.DATABASE.HOST
if (config.DATABASE.SOCKET !== "") {
poolConfig.socketPath = config.DATABASE.SOCKET;
} else {
poolConfig.host = config.DATABASE.HOST;
}
return poolConfig;
}