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:
committed by
GitHub
parent
880bbbd4af
commit
12fcb655cd
6
.changeset/early-rice-marry.md
Normal file
6
.changeset/early-rice-marry.md
Normal file
@@ -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 {
|
||||
await connection.connect()
|
||||
await new Promise(async resolve => {
|
||||
await connection.connect(resolve)
|
||||
})
|
||||
logger?.info(`Connection to Redis in module 'event-bus-redis' established`)
|
||||
} catch (err) {
|
||||
logger?.error(
|
||||
|
||||
@@ -7,7 +7,7 @@ export default async ({
|
||||
container,
|
||||
logger,
|
||||
options,
|
||||
dataLoaderOnly
|
||||
dataLoaderOnly,
|
||||
}: LoaderOptions): Promise<void> => {
|
||||
const {
|
||||
url,
|
||||
@@ -80,7 +80,9 @@ async function getConnection(url, redisOptions) {
|
||||
...(redisOptions ?? {}),
|
||||
})
|
||||
|
||||
await connection.connect()
|
||||
await new Promise(async (resolve) => {
|
||||
await connection.connect(resolve)
|
||||
})
|
||||
|
||||
return connection
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user