diff --git a/api/app/postgresql.js b/api/app/postgresql.js index c4a317a..2bee80a 100644 --- a/api/app/postgresql.js +++ b/api/app/postgresql.js @@ -25,7 +25,8 @@ pool.on("error", (err, clients) => { }); const search = async (itemName) => { - // await logger.info('pool details: ' + JSON.stringify(pool)); + const poolDetails = await asyncStringify(pool); + await logger.info('pool details: ' + poolDetails); await dnsPromises.lookup(pool.options.host, dnsOptions).then(async (result) => { await logger.info('DNS lookup for host ' + pool.options.host + ': %j', result); }); @@ -66,6 +67,12 @@ const importData = () => { })().catch((e) => logger.error(e.stack)); }; +function asyncStringify(str) { + return new Promise((resolve, reject) => { + resolve(JSON.stringify(str)); + }); +} + module.exports = Object.assign({ search, importData,