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:
parent
f9a8edb1a0
commit
d5b1552dc9
1 changed files with 3 additions and 6 deletions
|
@ -4,10 +4,7 @@ const db = require('../data/db');
|
||||||
const LimitService = require('@tryghost/limit-service');
|
const LimitService = require('@tryghost/limit-service');
|
||||||
let limitService = new LimitService();
|
let limitService = new LimitService();
|
||||||
|
|
||||||
/**
|
const init = () => {
|
||||||
* @param {Object} [limits] - An object containing limit configuration
|
|
||||||
**/
|
|
||||||
const initFn = (limits = {}) => {
|
|
||||||
let helpLink;
|
let helpLink;
|
||||||
|
|
||||||
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
|
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') || {};
|
const hostLimits = config.get('hostSettings:limits') || {};
|
||||||
|
|
||||||
limitService.loadLimits({
|
limitService.loadLimits({
|
||||||
limits: Object.assign(hostLimits, limits),
|
limits: hostLimits,
|
||||||
subscription,
|
subscription,
|
||||||
db,
|
db,
|
||||||
helpLink,
|
helpLink,
|
||||||
|
@ -38,4 +35,4 @@ const initFn = (limits = {}) => {
|
||||||
|
|
||||||
module.exports = limitService;
|
module.exports = limitService;
|
||||||
|
|
||||||
module.exports.init = initFn;
|
module.exports.init = init;
|
||||||
|
|
Loading…
Add table
Reference in a new issue