feat(medusa): Allow configuring of staged job polling batch size (#6333)

This commit is contained in:
Oli Juhl
2024-02-07 10:35:49 +01:00
committed by GitHub
parent 44470bf8c5
commit 82c728bec7
3 changed files with 24 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
---
"@medusajs/medusa": patch
"@medusajs/types": patch
---
feat(medusa): Allow configuring of staged job polling batch size

View File

@@ -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) {

View File

@@ -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
}
/**