Fork me on GitHub
#leiningen
<
2020-10-26
>
noisesmith15:10:52

@joao.galrito don't use lein itself in production, use lein uberjar to make a jar, then run it via java

João Galrito23:10:11

Alright, I had searched online for "deploy clojure apps to production" and a lot of people talked about being fine using lein

noisesmith01:10:55

the problem is that there's no advantage to lein in production, and there are actual disadvantages (in terms of resource usage, startup time for example)

noisesmith15:10:02

there are also dedicated libraries for managing long running java programs, eg. jsvc

zilti16:10:03

It is also really simple to write a .service file for systemd (or an rc file if on BSD) for running an uberjar

noisesmith16:10:49

with a .service file how do you handle controlled shutdown - via signal handler?

zilti16:10:38

Well, if you absolutely have to have code run on shutdown, you can use Runtime's addShutdownHook but so far I wasn't in a situation where that was needed

noisesmith16:10:10

regardless - don't use lein as a prod launcher, it's just a bad idea