fix(postgresql): close connections when done
This commit is contained in:

committed by
Ali BARIN

parent
110c2dbac8
commit
8e9896ec2e
@@ -102,6 +102,8 @@ export default defineAction({
|
|||||||
})
|
})
|
||||||
.del() as IJSONArray;
|
.del() as IJSONArray;
|
||||||
|
|
||||||
|
client.destroy();
|
||||||
|
|
||||||
$.setActionItem({
|
$.setActionItem({
|
||||||
raw: {
|
raw: {
|
||||||
rows: response
|
rows: response
|
||||||
|
@@ -88,6 +88,8 @@ export default defineAction({
|
|||||||
.returning('*')
|
.returning('*')
|
||||||
.insert(data) as IJSONObject;
|
.insert(data) as IJSONObject;
|
||||||
|
|
||||||
|
client.destroy();
|
||||||
|
|
||||||
$.setActionItem({ raw: response[0] as IJSONObject });
|
$.setActionItem({ raw: response[0] as IJSONObject });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@@ -46,6 +46,7 @@ export default defineAction({
|
|||||||
|
|
||||||
const queryStatemnt = $.step.parameters.queryStatement;
|
const queryStatemnt = $.step.parameters.queryStatement;
|
||||||
const { rows } = await client.raw(queryStatemnt);
|
const { rows } = await client.raw(queryStatemnt);
|
||||||
|
client.destroy();
|
||||||
|
|
||||||
$.setActionItem({
|
$.setActionItem({
|
||||||
raw: {
|
raw: {
|
||||||
|
@@ -132,6 +132,8 @@ export default defineAction({
|
|||||||
})
|
})
|
||||||
.update(data) as IJSONArray;
|
.update(data) as IJSONArray;
|
||||||
|
|
||||||
|
client.destroy();
|
||||||
|
|
||||||
$.setActionItem({
|
$.setActionItem({
|
||||||
raw: {
|
raw: {
|
||||||
rows: response
|
rows: response
|
||||||
|
@@ -5,6 +5,7 @@ import getClient from '../common/postgres-client';
|
|||||||
const verifyCredentials = async ($: IGlobalVariable) => {
|
const verifyCredentials = async ($: IGlobalVariable) => {
|
||||||
const client = getClient($);
|
const client = getClient($);
|
||||||
const checkConnection = await client.raw('SELECT 1');
|
const checkConnection = await client.raw('SELECT 1');
|
||||||
|
client.destroy();
|
||||||
|
|
||||||
logger.debug(checkConnection);
|
logger.debug(checkConnection);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user