mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-21 01:41:46 +03:00
edd0e26a78
refs https://github.com/TryGhost/Team/issues/599 - This is a precursor change to tests which verify the hostSettings limits are working correctly - Bumped limits-service version which allows for multiple calls of loadLimits on the same service instance
22 lines
702 B
JavaScript
22 lines
702 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 initFn = () => {
|
|
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/';
|
|
}
|
|
|
|
limitService.loadLimits({limits: config.get('hostSettings:limits'), db, helpLink, errors});
|
|
};
|
|
|
|
module.exports = limitService;
|
|
|
|
module.exports.init = initFn;
|