mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
29 lines
756 B
JavaScript
29 lines
756 B
JavaScript
|
/**
|
||
|
* {
|
||
|
* [adapterType]: {
|
||
|
* active: [adapterName],
|
||
|
* [adapterName]: {}
|
||
|
* }
|
||
|
* }
|
||
|
*/
|
||
|
module.exports = function getAdapterServiceConfig(config) {
|
||
|
const adapterServiceConfig = config.get('adapters');
|
||
|
|
||
|
if (!adapterServiceConfig.storage) {
|
||
|
adapterServiceConfig.storage = config.get('storage');
|
||
|
}
|
||
|
|
||
|
if (!adapterServiceConfig.scheduling) {
|
||
|
const schedulingConfig = config.get('scheduling');
|
||
|
const activeSchedulingAdapter = schedulingConfig.active;
|
||
|
adapterServiceConfig.scheduling = {
|
||
|
active: activeSchedulingAdapter,
|
||
|
[activeSchedulingAdapter]: {
|
||
|
schedulerUrl: schedulingConfig.schedulerUrl
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
return adapterServiceConfig;
|
||
|
};
|