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:
5
.changeset/rare-tips-raise.md
Normal file
5
.changeset/rare-tips-raise.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
fix(medusa): products retrieve uses query strategy for performance
|
||||
@@ -18,7 +18,7 @@ const {
|
||||
simpleShippingOptionFactory,
|
||||
} = require("../../../factories")
|
||||
|
||||
jest.setTimeout(50000)
|
||||
jest.setTimeout(150000)
|
||||
|
||||
const adminHeaders = { headers: { Authorization: "Bearer test_token" } }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ const { setPort, useApi } = require("../../../helpers/use-api")
|
||||
|
||||
const adminSeeder = require("../../helpers/admin-seeder")
|
||||
|
||||
jest.setTimeout(50000)
|
||||
jest.setTimeout(10000)
|
||||
|
||||
const {
|
||||
simpleOrderFactory,
|
||||
|
||||
@@ -27,6 +27,7 @@ module.exports = {
|
||||
database_type: "postgres",
|
||||
jwt_secret: "test",
|
||||
cookie_secret: "test",
|
||||
database_extra: { idle_in_transaction_session_timeout: 0 }
|
||||
},
|
||||
modules: {
|
||||
stockLocationService: {
|
||||
|
||||
@@ -72,7 +72,10 @@ export const ProductRepository = dataSource.getRepository(Product).extend({
|
||||
async findOne(
|
||||
options: ExtendedFindConfig<Product & ProductFilterOptions>
|
||||
): 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()
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user