feat(medusa): Allow configuring of staged job polling batch size (#6333)
This commit is contained in:
6
.changeset/odd-keys-retire.md
Normal file
6
.changeset/odd-keys-retire.md
Normal file
@@ -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(
|
||||
{ stagedJobService, logger }: InjectedDependencies,
|
||||
config,
|
||||
config: ConfigModule,
|
||||
isSingleton = true
|
||||
) {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
@@ -201,7 +201,7 @@ export default class EventBusService
|
||||
const listConfig = {
|
||||
relations: [],
|
||||
skip: 0,
|
||||
take: 1000,
|
||||
take: this.config_.projectConfig.jobs_batch_size ?? 1000,
|
||||
}
|
||||
|
||||
while (this.shouldEnqueuerRun) {
|
||||
|
||||
@@ -467,6 +467,22 @@ export type ProjectConfigOptions = {
|
||||
* ```
|
||||
*/
|
||||
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