Skip to content

Commit

Permalink
Add webpackIgnore annotation on dynamic conductor dependencies (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
tardieu authored and reggeenr committed Mar 12, 2021
1 parent ddf67c7 commit 477af79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions conductor.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = { generate }

// runtime code
function main (composition) {
const openwhisk = require('openwhisk')
const openwhisk = require(/* webpackIgnore: true */ 'openwhisk')
let wsk
let db
const expiration = 86400 // expire redis key after a day
Expand All @@ -50,11 +50,11 @@ function main (composition) {
function done (id) { return `composer/join/${id}` }

function createRedisClient (p) {
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 client = require(/* webpackIgnore: true */ '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))
require('redis-commands').list.forEach(f => {
require(/* webpackIgnore: true */ 'redis-commands').list.forEach(f => {
client[`${f}Async`] = function () {
let failed = false
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -100,7 +100,7 @@ function main (composition) {
return
}
const stack = [{ marker: true }].concat(p.s.stack)
const barrierId = require('uuid').v4()
const barrierId = require(/* webpackIgnore: true */ 'uuid').v4()
console.log(`barrierId: ${barrierId}, spawning: ${array.length}`)
if (!wsk) wsk = openwhisk(p.s.openwhisk)
if (!db) db = createRedisClient(p)
Expand Down

0 comments on commit 477af79

Please sign in to comment.