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:
Adrien de Peretti
2024-04-04 20:40:41 +02:00
committed by GitHub
parent 880bbbd4af
commit 12fcb655cd
3 changed files with 13 additions and 3 deletions

View File

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