fix(medusa): Use query relation load strategy on Products (#3926)
* fix(medusa): products retrieve uses query strategy for performance * chore: packaged version of medusa typeorm fix * chore: update path * chore: stock locations uses typeorm version * chore: resolve typeorm to medusa package * chore: Update medusa project in CI action * chore: temp disable transaction timeout for plugins --------- Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: olivermrbl <oliver@mrbltech.com>
This commit is contained in:
co-authored by
Oliver Windall Juhl
olivermrbl
parent
c04cbbaa1b
commit
4e8045a0ac
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa): products retrieve uses query strategy for performance
|
||||||
@@ -18,7 +18,7 @@ const {
|
|||||||
simpleShippingOptionFactory,
|
simpleShippingOptionFactory,
|
||||||
} = require("../../../factories")
|
} = require("../../../factories")
|
||||||
|
|
||||||
jest.setTimeout(50000)
|
jest.setTimeout(150000)
|
||||||
|
|
||||||
const adminHeaders = { headers: { Authorization: "Bearer test_token" } }
|
const adminHeaders = { headers: { Authorization: "Bearer test_token" } }
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const { setPort, useApi } = require("../../../helpers/use-api")
|
|||||||
|
|
||||||
const adminSeeder = require("../../helpers/admin-seeder")
|
const adminSeeder = require("../../helpers/admin-seeder")
|
||||||
|
|
||||||
jest.setTimeout(50000)
|
jest.setTimeout(10000)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
simpleOrderFactory,
|
simpleOrderFactory,
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ module.exports = {
|
|||||||
database_type: "postgres",
|
database_type: "postgres",
|
||||||
jwt_secret: "test",
|
jwt_secret: "test",
|
||||||
cookie_secret: "test",
|
cookie_secret: "test",
|
||||||
|
database_extra: { idle_in_transaction_session_timeout: 0 }
|
||||||
},
|
},
|
||||||
modules: {
|
modules: {
|
||||||
stockLocationService: {
|
stockLocationService: {
|
||||||
|
|||||||
@@ -72,7 +72,10 @@ export const ProductRepository = dataSource.getRepository(Product).extend({
|
|||||||
async findOne(
|
async findOne(
|
||||||
options: ExtendedFindConfig<Product & ProductFilterOptions>
|
options: ExtendedFindConfig<Product & ProductFilterOptions>
|
||||||
): Promise<Product | null> {
|
): Promise<Product | null> {
|
||||||
const queryBuilder = await this.prepareQueryBuilder_(options)
|
const options_ = { ...options }
|
||||||
|
options_.relationLoadStrategy = "query"
|
||||||
|
|
||||||
|
const queryBuilder = await this.prepareQueryBuilder_(options_)
|
||||||
return await queryBuilder.getOne()
|
return await queryBuilder.getOne()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user