mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Fixed email analytics job not being registered when creating an email
no issue - job registration was checking for submitted emails in it's email count but the job registration method is called as soon as an email is created meaning the email has a status of 'pending' which prevented the analytics job from being started until a second email was sent
This commit is contained in:
parent
f802128cfc
commit
166d072cd4
1 changed files with 1 additions and 1 deletions
|
@ -17,8 +17,8 @@ module.exports = {
|
|||
// don't register email analytics job if we have no emails,
|
||||
// processer usage from many sites spinning up threads can be high
|
||||
const emailCount = await models.Email
|
||||
.where('status', 'submitted')
|
||||
.where('created_at', '>', moment.utc().subtract(30, 'days').toDate())
|
||||
.whereNot('status', 'failed')
|
||||
.count();
|
||||
|
||||
if (emailCount > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue