mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Remove wrapper function in PersistorManager
This commit is contained in:
parent
dbfacce988
commit
0329c759dc
1 changed files with 22 additions and 24 deletions
|
@ -1,28 +1,26 @@
|
||||||
const settings = require('settings-sharelatex')
|
const settings = require('settings-sharelatex')
|
||||||
const logger = require('logger-sharelatex')
|
const logger = require('logger-sharelatex')
|
||||||
|
|
||||||
module.exports = (function() {
|
logger.log(
|
||||||
logger.log(
|
{
|
||||||
{
|
backend: settings.filestore.backend
|
||||||
backend: settings.filestore.backend
|
},
|
||||||
},
|
'Loading backend'
|
||||||
'Loading backend'
|
)
|
||||||
)
|
if (!settings.filestore.backend) {
|
||||||
|
throw new Error('no backend specified - config incomplete')
|
||||||
|
}
|
||||||
|
|
||||||
if (!settings.filestore.backend) {
|
switch (settings.filestore.backend) {
|
||||||
throw new Error('no backend specified - config incomplete')
|
case 'aws-sdk':
|
||||||
}
|
module.exports = require('./AWSSDKPersistorManager')
|
||||||
|
break
|
||||||
switch (settings.filestore.backend) {
|
case 's3':
|
||||||
case 'aws-sdk':
|
module.exports = require('./S3PersistorManager')
|
||||||
return require('./AWSSDKPersistorManager')
|
break
|
||||||
case 's3':
|
case 'fs':
|
||||||
return require('./S3PersistorManager')
|
module.exports = require('./FSPersistorManager')
|
||||||
case 'fs':
|
break
|
||||||
return require('./FSPersistorManager')
|
default:
|
||||||
default:
|
throw new Error(`unknown filestore backend: ${settings.filestore.backend}`)
|
||||||
throw new Error(
|
}
|
||||||
`unknown filestore backend: ${settings.filestore.backend}`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
})()
|
|
||||||
|
|
Loading…
Reference in a new issue