Fork me on GitHub
#luminus
<
2021-11-05
>
kopio11:11:07

Hey, what is the benefit of using mount with config/env in the luminus-template instead of just (def env (load-config))? We have had some problems with the mounting as that has caused env to be nil in some situations (e.g. using an env var in another def form). I would like to know if it is safe to remove the mount before it is deployed to production 😅

tobias11:11:56

Probably not the answer you're looking for but one way to get around the nil env problem is to define the var that depends on env as a function (of no arguments) instead of a var. That way its evaluation is delayed until a time when (presumably) env has a non nil value

kopio14:11:58

That's how we have currently handled the issue, but is quite easy to forget this problem and reintroduce the bug elsewhere

kopio13:11:55

This change is now in production and everything is working fine 😅

tobias12:11:12

That's good to know that plain def works fine for env. I've tripped over the issue you described a few times.