Fixed limits realoding during soft Ghost restart

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
This commit is contained in:
Naz 2021-04-10 00:05:43 +12:00
parent e5b13ee5d2
commit edd0e26a78
4 changed files with 9 additions and 9 deletions

View File

@ -7,10 +7,6 @@ let limitService = new LimitService();
const initFn = () => { const initFn = () => {
let helpLink; let helpLink;
if (!config.get('hostSettings') || !config.get('hostSettings:limits')) {
return;
}
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')) {
helpLink = config.get('hostSettings:billing:url'); helpLink = config.get('hostSettings:billing:url');
} else { } else {

View File

@ -56,7 +56,7 @@
"@tryghost/kg-default-cards": "4.0.2", "@tryghost/kg-default-cards": "4.0.2",
"@tryghost/kg-markdown-html-renderer": "4.0.1", "@tryghost/kg-markdown-html-renderer": "4.0.1",
"@tryghost/kg-mobiledoc-html-renderer": "4.0.0", "@tryghost/kg-mobiledoc-html-renderer": "4.0.0",
"@tryghost/limit-service": "0.4.0", "@tryghost/limit-service": "0.4.1",
"@tryghost/magic-link": "1.0.0", "@tryghost/magic-link": "1.0.0",
"@tryghost/members-api": "1.1.1", "@tryghost/members-api": "1.1.1",
"@tryghost/members-csv": "1.0.0", "@tryghost/members-csv": "1.0.0",

View File

@ -24,6 +24,7 @@ const frontendSettingsService = require('../../core/frontend/services/settings')
const settingsCache = require('../../core/server/services/settings/cache'); const settingsCache = require('../../core/server/services/settings/cache');
const web = require('../../core/server/web'); const web = require('../../core/server/web');
const themes = require('../../core/frontend/services/themes'); const themes = require('../../core/frontend/services/themes');
const limits = require('../../core/server/services/limits');
// Other Test Utilities // Other Test Utilities
const APIUtils = require('./api'); const APIUtils = require('./api');
@ -205,6 +206,9 @@ const restartModeGhostStart = async () => {
// Trigger themes to load again // Trigger themes to load again
themes.loadInactiveThemes(); themes.loadInactiveThemes();
// Reload limits service
limits.init();
}; };
const bootGhost = async () => { const bootGhost = async () => {

View File

@ -559,10 +559,10 @@
dependencies: dependencies:
"@tryghost/kg-clean-basic-html" "^1.0.13" "@tryghost/kg-clean-basic-html" "^1.0.13"
"@tryghost/limit-service@0.4.0": "@tryghost/limit-service@0.4.1":
version "0.4.0" version "0.4.1"
resolved "https://registry.yarnpkg.com/@tryghost/limit-service/-/limit-service-0.4.0.tgz#a681eb866171a6966162db87ae0d18ccb1fbb965" resolved "https://registry.yarnpkg.com/@tryghost/limit-service/-/limit-service-0.4.1.tgz#c827e8a334854766f073520ae5dab12e132e0945"
integrity sha512-DVWYiKgvXzWqi+L2jJPhTQLogiRZUJw+bX9XMmLg202rnNAn8A9eYIAmWu5TbY4Gp0+6gz6IZFdIIocGDtA8Aw== integrity sha512-MYcW+s4+OfA9C/tI7e0ZKhxUk02tVhkcrBc/7p+BgiJnS+LdcgrV21xRqH/UhERotgOLcFRTHPt6bkqW1Lnhwg==
dependencies: dependencies:
lodash "^4.17.21" lodash "^4.17.21"