duct

walterl 2020-07-17T00:33:37.269200Z

When compiling class files for my project with (binding [*compile-files* true] (dev)) (deduced from https://clojure.org/guides/dev_startup_time), and running (reset) from integrant.repl, I get the error below. Has anyone seen something like this before? Does reset have trouble with detecting changes to sources when class files are present (hinted at by the fact that :reloading lists all namespaces).

kwrooijen 2020-07-17T07:25:47.269700Z

I've had this problem (without the binding) but what worked for me was running lein clean

walterl 2020-07-17T12:49:17.269900Z

Yeah, that does it, but it nukes the whole target/default+repl+repl dir, which is where the class files lives that improves startup time by 75% (from 16s to 4s) in my case.

kwrooijen 2020-07-17T12:55:48.270100Z

Hmm, not sure what to do about that sadly. Haven't even heard of class files to improve startup time

walterl 2020-07-17T12:58:19.270300Z

It's described here https://clojure.org/guides/dev_startup_time 🙂

kwrooijen 2020-07-17T13:03:36.270500Z

Thanks for the link

👍 1
Carl 2020-07-17T13:48:37.273Z

Hi there! I'd like to remove :duct.middleware.web/log-errors in production. But I did not find any way to remove keys in a profile. How does one go about that? Thanks in advance!

kwrooijen 2020-07-17T13:52:34.274800Z

I had the same issue not too long ago. I'm honestly not sure if there's an option to remove it (I don't think so) What you could try (I haven't tested this) is to dissoc the :duct.middleware.web/log-errors after running duct.core/prep-config in your main.clj However, what might work (haven't tested it), is that you could dissoc the

kwrooijen 2020-07-17T13:53:12.275500Z

Normally you use the duct.core/exec-config function, to prep and init your config, and finally block for daemons

kwrooijen 2020-07-17T13:54:40.276800Z

Instead, maybe this could work in your main.clj file:

(-> config
    (duct.core/prep-config profiles)
    (dissoc :duct.middleware.web/log-errors)
    (ig/init keys)
    (duct/.core/await-daemons)))

kwrooijen 2020-07-17T13:57:37.278200Z

Again, I haven't tested this. But I think it should work

kwrooijen 2020-07-17T14:03:30.278500Z

Hmm. sorry this probably won't work 😞

kwrooijen 2020-07-17T14:05:40.279400Z

Alternatively you could override it with your own ig/init-key but that's a bit hacky