Fork me on GitHub
#component
<
2017-10-31
>
kvlt16: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 {}))

kvlt16:10:59

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

kvlt16: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

kvlt16:10:31

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

kvlt16:10:12

Thats what I was thinking I had to do 😞