Fork me on GitHub

@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


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)


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


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


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


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


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