Fork me on GitHub
#component
<
2017-10-31
>
PB16:10:43

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

hiredman16:10:41

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

PB16:10:59

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

PB16:10:32

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

hiredman16:10:50

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

hiredman16:10:11

component extends the lifecycle protocol to Object but not to nil

PB16:10:31

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

PB16:10:12

Thats what I was thinking I had to do 😞