component

PB 2017-10-31T16:32:43.000236Z

Hey all. I have a component that I only want to start in certain environments. Is there a way I can accomplish this?

2017-10-31T16:50:41.000326Z

(when (System/env "SOME_THING) (map->MyComponent {}))

PB 2017-10-31T16:52:59.000508Z

HMm I did something similar but maybe it was in the wrong place

PB 2017-10-31T16:53:32.000040Z

Oh I did exactly that. Component is throwing an exception regarding nils inside of the system map

2017-10-31T16:53:50.000552Z

you may need to use if instead of when and have :nothing as the missing case

2017-10-31T16:54:11.000179Z

component extends the lifecycle protocol to Object but not to nil

PB 2017-10-31T16:54:31.000510Z

(when (= "true" (System/getenv "CREATE_QUEUES"))
     (map->Queue {:queue-name1 queue-name :queue-name2 queue-name}))

PB 2017-10-31T16:55:12.000023Z

Thats what I was thinking I had to do 😞