kit-clj / kit

Lightweight, modular framework for scalable web development in Clojure
https://kit-clj.github.io/
MIT License
476 stars 44 forks source link

Bugfix on Conman #140

Closed whamtet closed 5 months ago

whamtet commented 5 months ago

@yogthos

A few months ago you kindly accepted my PR to allow multiple hugsql scripts in system.edn. The previous code inspects file edit time and if it has updated reloads conman. Now that we have multiple files we have to map over all the file edit times but of course map is lazy. As a result the previous edit times would get evaluated at the same time as the current one and never show any difference (!). Very easy fix!

Matt

yogthos commented 5 months ago

thanks, by the way you can also use mapv which is eager. :)

gerdint commented 4 months ago

This was probably my bad. I do remember testing it but looking at the code I cannot understand how... Anyways, thanks for fixing it!

yogthos commented 4 months ago

teamwork :)

yogthos commented 4 months ago

@gerdint @whamtet so, it turns out that we have a new problem now, eager evaluation looks to be causing an error running from the uberjar

1429  INFO  server.app.env -
-=[app started successfully]=-
1430  INFO  kit.config - Reading config system.edn
1633  ERROR server.app.core - {:what :uncaught-exception, :exception #error {
 :cause nil
 :via
 [{:type clojure.lang.ExceptionInfo
   :message Error on key :db.sql/query-fn when building system
   :data {:reason :integrant.core/build-threw-exception, :system {:db.sql/connection #object[com.zaxxer.hikari.HikariDataSource 0x7906de2f HikariDataSource (HikariPool-1)]}, :function #object[clojure.lang.MultiFn 0x574f89bf clojure.lang.MultiFn@574f89bf], :key :db.sql/query-fn, :value {:conn #object[com.zaxxer.hikari.HikariDataSource 0x7906de2f HikariDataSource (HikariPool-1)], :options {}, :filename queries.sql}}
   :at [integrant.core$build_exception invokeStatic core.cljc 296]}
  {:type java.nio.file.FileSystemNotFoundException
   :message nil
   :at [jdk.nio.zipfs.ZipFileSystemProvider getFileSystem ZipFileSystemProvider.java 156]}]
yogthos commented 4 months ago

and added fix for last-modified to handle jar gracefully https://github.com/kit-clj/kit/blob/2cc5d77adeb601d268ab9cf7f67a6cae565d878c/libs/kit-core/src/kit/ig_utils.clj

whamtet commented 4 months ago

Great work @yogthos

gerdint commented 4 months ago

Thanks @yogthos!