Skip to content

Commit

Permalink
Fix redisOptions passing
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed Jul 13, 2023
1 parent 02b91a1 commit faf41bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/@uppy/companion/src/server/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let redisClient
*/
function createClient (opts) {
if (!redisClient) {
console.log('NEW REDIS', opts)
redisClient = new Redis(opts)

redisClient.on('error', err => logger.error('redis error', err.toString()))
Expand All @@ -20,10 +21,10 @@ function createClient (opts) {
return redisClient
}

module.exports.client = (companionOptions) => {
if (!companionOptions) {
module.exports.client = (redisOptions) => {
if (!redisOptions) {
return redisClient
}

return createClient({ ...companionOptions.redisOptions, url: companionOptions.redisUrl })
return createClient(redisOptions)
}

0 comments on commit faf41bd

Please sign in to comment.