0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Simlified limit service initialization

refs https://linear.app/tryghost/issue/CORE-121/create-a-video-storage-adapter

- Init function for the limits service initialization is never called with parameters, so it doesn't make sense to keep that option around and have unnecessary logic handling it
This commit is contained in:
Naz 2021-10-25 16:56:15 +04:00 committed by naz
parent f9a8edb1a0
commit d5b1552dc9

View file

@ -4,10 +4,7 @@ const db = require('../data/db');
const LimitService = require('@tryghost/limit-service');
let limitService = new LimitService();
/**
* @param {Object} [limits] - An object containing limit configuration
**/
const initFn = (limits = {}) => {
const init = () => {
let helpLink;
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
@ -28,7 +25,7 @@ const initFn = (limits = {}) => {
const hostLimits = config.get('hostSettings:limits') || {};
limitService.loadLimits({
limits: Object.assign(hostLimits, limits),
limits: hostLimits,
subscription,
db,
helpLink,
@ -38,4 +35,4 @@ const initFn = (limits = {}) => {
module.exports = limitService;
module.exports.init = initFn;
module.exports.init = init;