mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
🐛 Fixed email sending job execution
refs https://github.com/TryGhost/Toolbox/issues/359 - Sending newsletters got broken because underlying "inline job" execution had a bug. - The real problem was in the job manager trying to verify inline unnamed job status in the database without having a name.
This commit is contained in:
parent
b0144a7f8f
commit
b7853323ae
@ -81,7 +81,7 @@ class JobManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async _jobMessageHandler({name, message}) {
|
async _jobMessageHandler({name, message}) {
|
||||||
if (this._jobsRepository) {
|
if (this._jobsRepository && name) {
|
||||||
if (message === 'started') {
|
if (message === 'started') {
|
||||||
const job = await this._jobsRepository.read(name);
|
const job = await this._jobsRepository.read(name);
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ describe('Job Manager', function () {
|
|||||||
describe('Inline jobs', function () {
|
describe('Inline jobs', function () {
|
||||||
it('adds a job to a queue', async function () {
|
it('adds a job to a queue', async function () {
|
||||||
const spy = sinon.spy();
|
const spy = sinon.spy();
|
||||||
const jobManager = new JobManager({});
|
const jobManager = new JobManager({
|
||||||
|
JobModel: sinon.stub().resolves()
|
||||||
|
});
|
||||||
|
|
||||||
jobManager.addJob({
|
jobManager.addJob({
|
||||||
job: spy,
|
job: spy,
|
||||||
|
Loading…
Reference in New Issue
Block a user