mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-24 17:00:06 +02:00

* [history-v1] add readOnly lookup for raw chunks Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com> * [history-v1] reduce min poolsize for readOnly pool to 0 Co-authored-by: Brian Gough <brian.gough@overleaf.com> --------- Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com> Co-authored-by: Brian Gough <brian.gough@overleaf.com> GitOrigin-RevId: a711c4ee4f3ea3775bd090e620d1ef52689fa1f4
19 lines
394 B
JavaScript
19 lines
394 B
JavaScript
'use strict'
|
|
|
|
const config = require('config')
|
|
const knexfile = require('../../knexfile')
|
|
|
|
const env = process.env.NODE_ENV || 'development'
|
|
|
|
if (config.databaseUrlReadOnly) {
|
|
module.exports = require('knex')({
|
|
...knexfile[env],
|
|
pool: {
|
|
...knexfile[env].pool,
|
|
min: 0,
|
|
},
|
|
connection: config.databaseUrlReadOnly,
|
|
})
|
|
} else {
|
|
module.exports = require('./knex')
|
|
}
|