Skip to content

Commit f2de0b9

Browse files
author
Guewen Baconnier
committed
Remove initial create notification and follower
Everytime a job is created, a mail.message "Queue Job created" is created. This is useless, as we already have the creation date and user, and nobody will ever want to receive a notification for a created job anyway. Removing the auto-subscription of the user that created the job makes sense as well since we automatically subscribe the queue job managers for failures, and we don't send other notifications. It allows to remove a lot of insertions of records (and of deletions when autovacuuming jobs).
1 parent 8fe68a4 commit f2de0b9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

queue_job/models/queue_job.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,10 @@ def create(self, vals_list):
186186
raise exceptions.AccessError(
187187
_("Queue jobs must created by calling 'with_delay()'.")
188188
)
189-
return super().create(vals_list)
189+
return super(
190+
QueueJob,
191+
self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)
192+
).create(vals_list)
190193

191194
def write(self, vals):
192195
if self.env.context.get("_job_edit_sentinel") is not self.EDIT_SENTINEL:

0 commit comments

Comments
 (0)