chore: Ensure Redis connection is ready with callback (#6924)
* chore(workflow-engine-redis): await for the connection callback * cleanup * cleanup * Create early-rice-marry.md * cleanup
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/event-bus-redis": patch
|
||||||
|
"@medusajs/workflow-engine-redis": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Chore/workflow engine loader redis
|
||||||
@@ -27,7 +27,9 @@ export default async ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await connection.connect()
|
await new Promise(async resolve => {
|
||||||
|
await connection.connect(resolve)
|
||||||
|
})
|
||||||
logger?.info(`Connection to Redis in module 'event-bus-redis' established`)
|
logger?.info(`Connection to Redis in module 'event-bus-redis' established`)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger?.error(
|
logger?.error(
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default async ({
|
|||||||
container,
|
container,
|
||||||
logger,
|
logger,
|
||||||
options,
|
options,
|
||||||
dataLoaderOnly
|
dataLoaderOnly,
|
||||||
}: LoaderOptions): Promise<void> => {
|
}: LoaderOptions): Promise<void> => {
|
||||||
const {
|
const {
|
||||||
url,
|
url,
|
||||||
@@ -80,7 +80,9 @@ async function getConnection(url, redisOptions) {
|
|||||||
...(redisOptions ?? {}),
|
...(redisOptions ?? {}),
|
||||||
})
|
})
|
||||||
|
|
||||||
await connection.connect()
|
await new Promise(async (resolve) => {
|
||||||
|
await connection.connect(resolve)
|
||||||
|
})
|
||||||
|
|
||||||
return connection
|
return connection
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user