You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ta...@apache.org on 2019/11/13 20:02:27 UTC

[openwhisk-composer] 01/01: Only require redis in conductor code when running parallel constructs

This is an automated email from the ASF dual-hosted git repository.

tardieu pushed a commit to branch optional-redis
in repository https://gitbox.apache.org/repos/asf/openwhisk-composer.git

commit 6af4b8e77c273cbe5ed86f553cd73e6891c113e8
Author: Olivier Tardieu <ta...@users.noreply.github.com>
AuthorDate: Wed Nov 13 15:01:47 2019 -0500

    Only require redis in conductor code when running parallel constructs
---
 conductor.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/conductor.js b/conductor.js
index 74c84bc..7d163b9 100644
--- a/conductor.js
+++ b/conductor.js
@@ -42,7 +42,6 @@ module.exports = { generate }
 // runtime code
 function main (composition) {
   const openwhisk = require('openwhisk')
-  const redis = require('redis')
   const uuid = require('uuid').v4
   let wsk
   let db
@@ -52,7 +51,7 @@ function main (composition) {
   function done (id) { return `composer/join/${id}` }
 
   function createRedisClient (p) {
-    const client = redis.createClient(p.s.redis.uri, p.s.redis.ca ? { tls: { ca: Buffer.from(p.s.redis.ca, 'base64').toString('binary') } } : {})
+    const client = require('redis').createClient(p.s.redis.uri, p.s.redis.ca ? { tls: { ca: Buffer.from(p.s.redis.ca, 'base64').toString('binary') } } : {})
     const noop = () => { }
     let handler = noop
     client.on('error', error => handler(error))