Skip to content

Commit

Permalink
Merge pull request #129 from gerdint/master
Browse files Browse the repository at this point in the history
Log resume status (in parity with other components)
  • Loading branch information
yogthos committed Feb 4, 2024
2 parents 4acfd27 + 19a234c commit fda3612
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions libs/kit-sql-conman/src/kit/edge/db/sql/conman.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns kit.edge.db.sql.conman
(:require
[clojure.tools.logging :as log]
[conman.core :as conman]
[integrant.core :as ig]
[kit.ig-utils :as ig-utils]))
Expand Down Expand Up @@ -35,9 +36,11 @@

(defmethod ig/resume-key :db.sql/query-fn
[k {:keys [filename filenames] :as opts} old-opts old-impl]
(if (and (= opts old-opts)
(= (map ig-utils/last-modified (or filenames [filename]))
(:mtimes (meta old-impl))))
old-impl
(do (ig/halt-key! k old-impl)
(ig/init-key k opts))))
(let [check-res (and (= opts old-opts)
(= (map ig-utils/last-modified (or filenames [filename]))
(:mtimes (meta old-impl))))]
(log/info k "resume check. Same?" check-res)
(if check-res
old-impl
(do (ig/halt-key! k old-impl)
(ig/init-key k opts)))))

0 comments on commit fda3612

Please sign in to comment.