mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
3d989eba23
refs https://github.com/TryGhost/Toolbox/issues/354 - this commit turns the Ghost repo into a monorepo so we can bring our internal packages back in, which makes life easier when working on Ghost
32 lines
792 B
JavaScript
32 lines
792 B
JavaScript
const urlService = require('../../core/server/services/url');
|
|
|
|
module.exports.isFinished = async () => {
|
|
let timeout;
|
|
|
|
return new Promise(function (resolve) {
|
|
(function retry() {
|
|
clearTimeout(timeout);
|
|
|
|
if (urlService.hasFinished()) {
|
|
return resolve();
|
|
}
|
|
|
|
timeout = setTimeout(retry, 50);
|
|
})();
|
|
});
|
|
};
|
|
|
|
// @TODO: unify all the reset/softTeset helpers so they either work how the main code works or the reasons why they are different are clear
|
|
module.exports.init = ({urlCache} = {}) => {
|
|
urlService.init({urlCache});
|
|
};
|
|
|
|
module.exports.reset = () => {
|
|
urlService.softReset();
|
|
},
|
|
|
|
module.exports.resetGenerators = () => {
|
|
urlService.resetGenerators();
|
|
urlService.resources.reset();
|
|
};
|