Fixed select not happening inside transaction for bulk post actions

no issue

This potentially caused Knex timeout connection pool errors.
This commit is contained in:
Simon Backx 2023-04-12 12:47:31 +02:00
parent eafbb2856c
commit d4e9c23f84

View File

@ -104,7 +104,8 @@ class PostsService {
const postRows = await this.models.Post.getFilteredCollectionQuery({
filter: options.filter,
status: 'all'
status: 'all',
transacting: options.transacting
}).leftJoin('emails', 'posts.id', 'emails.post_id').select('posts.id', 'emails.id as email_id');
const deleteIds = postRows.map(row => row.id);
@ -177,7 +178,8 @@ class PostsService {
const postRows = await this.models.Post.getFilteredCollectionQuery({
filter: options.filter,
status: 'all'
status: 'all',
transacting: options.transacting
}).select('posts.id');
const editIds = postRows.map(row => row.id);