feat(medusa): Allow configuring of staged job polling batch size (#6333)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
"@medusajs/types": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat(medusa): Allow configuring of staged job polling batch size
|
||||||
@@ -38,7 +38,7 @@ export default class EventBusService
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
{ stagedJobService, logger }: InjectedDependencies,
|
{ stagedJobService, logger }: InjectedDependencies,
|
||||||
config,
|
config: ConfigModule,
|
||||||
isSingleton = true
|
isSingleton = true
|
||||||
) {
|
) {
|
||||||
// eslint-disable-next-line prefer-rest-params
|
// eslint-disable-next-line prefer-rest-params
|
||||||
@@ -201,7 +201,7 @@ export default class EventBusService
|
|||||||
const listConfig = {
|
const listConfig = {
|
||||||
relations: [],
|
relations: [],
|
||||||
skip: 0,
|
skip: 0,
|
||||||
take: 1000,
|
take: this.config_.projectConfig.jobs_batch_size ?? 1000,
|
||||||
}
|
}
|
||||||
|
|
||||||
while (this.shouldEnqueuerRun) {
|
while (this.shouldEnqueuerRun) {
|
||||||
|
|||||||
@@ -467,6 +467,22 @@ export type ProjectConfigOptions = {
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
http_compression?: HttpCompressionOptions
|
http_compression?: HttpCompressionOptions
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure the number of staged jobs that are polled from the database. Default is 1000.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```js title="medusa-config.js"
|
||||||
|
* module.exports = {
|
||||||
|
* projectConfig: {
|
||||||
|
* jobs_batch_size: 100
|
||||||
|
* // ...
|
||||||
|
* },
|
||||||
|
* // ...
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
jobs_batch_size?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user