title: Function meant to send data to Redis server sends the data, but will not send success response
body: <p>My setJWT function sends a key/value pair to my local Redis server.  I've confirmed the data is set with the redis-cli tool.  However, the console.log(&quot;setJWT success&quot;) and res.json(response); in the function aren't triggered.</p>
  <p>Any idea what I'm doing wrong?</p>
  <pre><code>const redis = require('redis');
  const client = redis.createClient(process.env.REDIS_URL);
  
  client.connect();
  
  client.on('connect', () =&gt; {
      console.log('connected');
  });
  
  const setJWT = (key, value) =&gt; {
    
    return new Promise((resolve, reject) =&gt; {
      try {
        console.log(key, value)
        return client.set(key, value, (error, response) =&gt; {
          
          if (error) reject(error);
          resolve(response);
          console.log(&quot;setJWT success&quot;);
          res.json(response);
        });
      } catch (error) {
        reject(error);
      }
    });
  };
  
  </code></pre>