mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
Moved queue start into UrlServices init block
refs https://github.com/TryGhost/Toolbox/issues/125 - The "fetchResources" is only used from one place and does way to many things at once: - Fetches resources from the DB- - Hooks up event listeners - Starts the queue - These are three different things, and should be three different methods ideally
This commit is contained in:
parent
ef8852c5b6
commit
46c3b53979
@ -97,15 +97,7 @@ class Resources {
|
||||
});
|
||||
});
|
||||
|
||||
Promise.all(ops)
|
||||
.then(() => {
|
||||
// CASE: all resources are fetched, start the queue
|
||||
this.queue.start({
|
||||
event: 'init',
|
||||
tolerance: 100,
|
||||
requiredSubscriberCount: 1
|
||||
});
|
||||
});
|
||||
return Promise.all(ops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -288,6 +288,12 @@ class UrlService {
|
||||
*/
|
||||
init() {
|
||||
this.resources.fetchResources();
|
||||
// CASE: all resources are fetched, start the queue
|
||||
this.queue.start({
|
||||
event: 'init',
|
||||
tolerance: 100,
|
||||
requiredSubscriberCount: 1
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user