Added query timeout setting.
This commit is contained in:
parent
6bf7fc5655
commit
1766556c49
|
@ -12,6 +12,7 @@ module.exports = {
|
||||||
password: 'password',
|
password: 'password',
|
||||||
database: 'traxxx',
|
database: 'traxxx',
|
||||||
},
|
},
|
||||||
|
timeout: 5000,
|
||||||
},
|
},
|
||||||
web: {
|
web: {
|
||||||
host: '0.0.0.0',
|
host: '0.0.0.0',
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/* eslint-disable arrow-body-style */
|
/* eslint-disable arrow-body-style */
|
||||||
|
const config = require('config');
|
||||||
const { postgraphile } = require('postgraphile');
|
const { postgraphile } = require('postgraphile');
|
||||||
|
|
||||||
const PgConnectionFilterPlugin = require('postgraphile-plugin-connection-filter');
|
const PgConnectionFilterPlugin = require('postgraphile-plugin-connection-filter');
|
||||||
|
@ -12,6 +13,7 @@ const { ActorPlugins, SitePlugins, ReleasePlugins, MediaPlugins } = require('./p
|
||||||
async function pgSettings(req) {
|
async function pgSettings(req) {
|
||||||
return {
|
return {
|
||||||
'user.id': req.session.user?.id || null, // undefined is passed as an empty string, avoid
|
'user.id': req.session.user?.id || null, // undefined is passed as an empty string, avoid
|
||||||
|
statement_timeout: config.database.timeout,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue