mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Moved url cache loading logic behind the flag
refs https://github.com/TryGhost/Toolbox/issues/125 - The url loader is not fully working and is in very experimental mode. The aim is to ship this version to allow other team members to play with the feature in limited use-cases like testing evnironment
This commit is contained in:
parent
5b2009a268
commit
04c6716171
@ -3,6 +3,7 @@ const _debug = require('@tryghost/debug')._base;
|
||||
const debug = _debug('ghost:services:url:service');
|
||||
const _ = require('lodash');
|
||||
const errors = require('@tryghost/errors');
|
||||
const labs = require('../../../shared/labs');
|
||||
const UrlGenerator = require('./UrlGenerator');
|
||||
const Queue = require('./Queue');
|
||||
const Urls = require('./Urls');
|
||||
@ -313,15 +314,15 @@ class UrlService {
|
||||
}
|
||||
|
||||
async persistUrls() {
|
||||
if (!this.urlCachePath) {
|
||||
if (!labs.isSet('urlCache') || !this.urlCachePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return fs.writeFileSync(this.urlCachePath, JSON.stringify(this.urls.urls, null, 4));
|
||||
return fs.writeFile(this.urlCachePath, JSON.stringify(this.urls.urls, null, 4));
|
||||
}
|
||||
|
||||
async fetchUrls() {
|
||||
if (!this.urlCachePath) {
|
||||
if (!labs.isSet('urlCache') || !this.urlCachePath) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user