Skip to content

Commit

Permalink
Merge pull request #134 from macielti/minor-improvement-datomic-compo…
Browse files Browse the repository at this point in the history
…nent

Minor improvement Datomic (Integrant) component
  • Loading branch information
macielti authored Sep 12, 2024
2 parents a844330 + 6de63f3 commit 6e803f2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ of [keepachangelog.com](http://keepachangelog.com/).

## [Unreleased]

## [29.61.62] - 2024-09-11

### Changed

- Minor improvement on Datomic (Integrant) component.

## [29.61.61] - 2024-09-11

### Added
Expand Down Expand Up @@ -886,6 +892,8 @@ of [keepachangelog.com](http://keepachangelog.com/).

[Unreleased]: https://github.com/macielti/common-clj/compare/v29.61.61...HEAD

[29.61.62]: https://github.com/macielti/common-clj/compare/v29.61.61...v29.61.62

[29.61.61]: https://github.com/macielti/common-clj/compare/v29.60.61...v29.61.61

[29.60.61]: https://github.com/macielti/common-clj/compare/v29.59.61...v29.60.61
Expand Down
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject net.clojars.macielti/common-clj "29.61.61"
(defproject net.clojars.macielti/common-clj "29.61.62"
:description "Just common Clojure code that I use across projects"
:url "https://github.com/macielti/common-clj"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
Expand Down
5 changes: 2 additions & 3 deletions src/common_clj/integrant_components/datomic.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
[schema.core :as s]
[taoensso.timbre :as log]
[diehard.core :as dh])
(:import (datomic.db Db)
(org.apache.activemq.artemis.api.core ActiveMQNotConnectedException)))
(:import (datomic.db Db)))

(s/defn transact-and-lookup-entity! :- {:entity (s/pred map?)
:db-after Db}
Expand Down Expand Up @@ -35,7 +34,7 @@
(log/info :starting ::datomic)
(let [datomic-uri (or (-> components :config :datomic-uri)
(str "datomic:mem://" (random-uuid)))
connection (dh/with-retry {:retry-on ActiveMQNotConnectedException
connection (dh/with-retry {:retry-on Exception
:max-retries 3}
(log/info ::database-created? (d/create-database datomic-uri))
(d/connect datomic-uri))]
Expand Down

0 comments on commit 6e803f2

Please sign in to comment.