mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
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:
parent
eafbb2856c
commit
d4e9c23f84
1 changed files with 4 additions and 2 deletions
|
@ -104,7 +104,8 @@ class PostsService {
|
||||||
|
|
||||||
const postRows = await this.models.Post.getFilteredCollectionQuery({
|
const postRows = await this.models.Post.getFilteredCollectionQuery({
|
||||||
filter: options.filter,
|
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');
|
}).leftJoin('emails', 'posts.id', 'emails.post_id').select('posts.id', 'emails.id as email_id');
|
||||||
const deleteIds = postRows.map(row => row.id);
|
const deleteIds = postRows.map(row => row.id);
|
||||||
|
|
||||||
|
@ -177,7 +178,8 @@ class PostsService {
|
||||||
|
|
||||||
const postRows = await this.models.Post.getFilteredCollectionQuery({
|
const postRows = await this.models.Post.getFilteredCollectionQuery({
|
||||||
filter: options.filter,
|
filter: options.filter,
|
||||||
status: 'all'
|
status: 'all',
|
||||||
|
transacting: options.transacting
|
||||||
}).select('posts.id');
|
}).select('posts.id');
|
||||||
|
|
||||||
const editIds = postRows.map(row => row.id);
|
const editIds = postRows.map(row => row.id);
|
||||||
|
|
Loading…
Add table
Reference in a new issue