**What** - Add index engine sync log information - Ad `setTimeout(0)` to give breath to the event loop and ensuring not blocking the event loop and allow for other tasks queue execution to happen while syncing here is an example: **LOG_LEVEL=info**  **LOG_LEVEL=debug** 
50 lines
1.1 KiB
JavaScript
50 lines
1.1 KiB
JavaScript
const {
|
|
defineConfig,
|
|
Modules,
|
|
ContainerRegistrationKeys,
|
|
} = require("@medusajs/framework/utils")
|
|
const { schema } = require("./schema")
|
|
|
|
export const dbName = "medusa-index-integration-2024"
|
|
const DB_HOST = process.env.DB_HOST ?? "localhost:5432"
|
|
const DB_USERNAME = process.env.DB_USERNAME ?? ""
|
|
const DB_PASSWORD = process.env.DB_PASSWORD ?? ""
|
|
const DB_URL = `postgres://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}/${dbName}`
|
|
|
|
const config = defineConfig({
|
|
admin: {
|
|
disable: true,
|
|
},
|
|
projectConfig: {
|
|
databaseUrl: DB_URL,
|
|
},
|
|
})
|
|
|
|
Object.keys(config.modules).forEach((key) => {
|
|
if ([Modules.EVENT_BUS].includes(key)) {
|
|
return
|
|
}
|
|
|
|
config.modules[key] = false
|
|
})
|
|
|
|
config.modules[Modules.INDEX] = {
|
|
resolve: "@medusajs/index",
|
|
dependencies: [
|
|
ContainerRegistrationKeys.LOGGER,
|
|
Modules.EVENT_BUS,
|
|
Modules.LOCKING,
|
|
ContainerRegistrationKeys.REMOTE_QUERY,
|
|
ContainerRegistrationKeys.QUERY,
|
|
],
|
|
options: {
|
|
schema,
|
|
},
|
|
}
|
|
|
|
config.modules[Modules.PRODUCT] = true
|
|
config.modules[Modules.LOCKING] = true
|
|
config.modules[Modules.PRICING] = true
|
|
|
|
export default config
|