mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 09:52:06 +03:00
d5b1552dc9
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
39 lines
1017 B
JavaScript
39 lines
1017 B
JavaScript
const errors = require('@tryghost/errors');
|
|
const config = require('../../shared/config');
|
|
const db = require('../data/db');
|
|
const LimitService = require('@tryghost/limit-service');
|
|
let limitService = new LimitService();
|
|
|
|
const init = () => {
|
|
let helpLink;
|
|
|
|
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
|
|
helpLink = config.get('hostSettings:billing:url');
|
|
} else {
|
|
helpLink = 'https://ghost.org/help/';
|
|
}
|
|
|
|
let subscription;
|
|
|
|
if (config.get('hostSettings:subscription')) {
|
|
subscription = {
|
|
startDate: config.get('hostSettings:subscription:start'),
|
|
interval: 'month'
|
|
};
|
|
}
|
|
|
|
const hostLimits = config.get('hostSettings:limits') || {};
|
|
|
|
limitService.loadLimits({
|
|
limits: hostLimits,
|
|
subscription,
|
|
db,
|
|
helpLink,
|
|
errors
|
|
});
|
|
};
|
|
|
|
module.exports = limitService;
|
|
|
|
module.exports.init = init;
|