diff --git a/build.clj b/build.clj index 701b10b..0c7a1ed 100644 --- a/build.clj +++ b/build.clj @@ -1,11 +1,11 @@ (ns build (:require [clojure.tools.build.api :as b] - [clojure.string :as str])) + [deps-deploy.deps-deploy :as dd])) (def lib 'com.fluree/raft) (def version "1.0.0") (def class-dir "target/classes") -(def basis (b/create-basis {:project "deps.edn"})) +(def basis (delay (b/create-basis {:project "deps.edn"}))) (def jar-file (format "target/%s-%s.jar" (name lib) version)) (defn clean [_] @@ -15,12 +15,20 @@ (b/write-pom {:class-dir class-dir :lib lib :version version - :basis basis + :basis @basis :src-dirs ["src"] + :src-pom nil :scm {:url "https://github.com/fluree/raft" :connection "scm:git:git://github.com/fluree/raft.git" :developerConnection "scm:git:ssh://git@github.com/fluree/raft.git" - :tag (str "v" version)}}) + :tag (str "v" version)} + :pom-data [[:description "A Raft consensus algorithm implementation for Clojure"] + [:url "https://github.com/fluree/raft"] + [:licenses + [:license + [:name "Eclipse Public License 1.0"] + [:url "https://opensource.org/license/epl-1-0/"] + [:distribution "repo"]]]]}) (b/copy-dir {:src-dirs ["src" "resources"] :target-dir class-dir}) (b/jar {:class-dir class-dir @@ -28,7 +36,7 @@ (defn install [_] (jar nil) - (b/install {:basis basis + (b/install {:basis @basis :lib lib :version version :jar-file jar-file @@ -36,12 +44,6 @@ (defn deploy [_] (jar nil) - (try - ((requiring-resolve 'deps-deploy.deps-deploy/deploy) - {:installer :remote - :artifact jar-file - :pom-file (b/pom-path {:lib lib :class-dir class-dir})}) - (catch Exception e - (if-not (str/includes? (ex-message e) "Could not find artifact") - (throw e) - (println "Ignoring deploy exception:" (ex-message e)))))) \ No newline at end of file + (dd/deploy {:installer :remote + :artifact (b/resolve-path jar-file) + :pom-file (b/pom-path {:lib lib :class-dir class-dir})})) \ No newline at end of file diff --git a/deps.edn b/deps.edn index 6e470c4..80356ad 100644 --- a/deps.edn +++ b/deps.edn @@ -49,5 +49,5 @@ :main-opts ["-m" "clj-kondo.main" "--lint" "src" "--config" ".clj-kondo/config.edn"]} :cljfmt - {:extra-deps {cljfmt/cljfmt {:mvn/version "0.10.5"}} + {:extra-deps {dev.weavejester/cljfmt {:mvn/version "0.10.5"}} :main-opts ["-m" "cljfmt.main"]}}} diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 6b5645c..0000000 --- a/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - jar - raft - raft - 0.1.0 - raft - - - org.clojure - clojure - 1.11.1 - - - org.clojure - tools.logging - 1.2.4 - - - com.taoensso - nippy - 3.2.0 - - - org.clojure - core.async - 1.6.673 - - - - src - - - - clojars - https://repo.clojars.org/ - - - diff --git a/pom.xml.asc b/pom.xml.asc deleted file mode 100644 index caf3ade..0000000 --- a/pom.xml.asc +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Comment: GPGTools - https://gpgtools.org - -iQEzBAABCgAdFiEEmJTQOjkqEwye3DYXVjnky/oX3IQFAl9X0eAACgkQVjnky/oX -3IRtCAf6AtUuRnixZgSrtzQlwD7ItvxAUTzd9NcBgRzCVzXzB+8m2lATIYX8OKJF -P2pUJwnP2zW1BSrH+HM1oIfUGjKtAR9oxsPhFbBDwXnF8GtYeIKk89Y/258zuIjI -qAXf5G5cYt4eqEl7CA4o6CiKDuZlvfpj38qSHxnYLqvbVpVJxFgibnoNCf9cyLJl -pKZaR9gQ78udfz648qCrdMzIAuhlIWFBBpXjkpQ2aerlQ5AYUhnp1PgUZ4bkUUUz -GCcQSw7Y8tlggzMN1a9uVJ2sJCQ3IU/x5s5kHVJ6sbjNlmjwZlUSNQtOjcwmjLI2 -YLE3lv8bccuI9ipEeQu3Xq1ggBFS3g== -=PcjW ------END PGP SIGNATURE----- diff --git a/src/fluree/raft/events.clj b/src/fluree/raft/events.clj index 8661ffd..4ef0b70 100644 --- a/src/fluree/raft/events.clj +++ b/src/fluree/raft/events.clj @@ -62,10 +62,10 @@ raft-state* (dissoc raft-state :msg-queue)] (reduce-kv (fn [raft-state* server-id message] - (apply send-rpc-fn raft-state* server-id message) - (if-let [msgs (get-in raft-state* [:servers server-id :stats :sent])] - (assoc-in raft-state* [:servers server-id :stats :sent] (inc msgs)) - raft-state*)) + (let [_ (apply send-rpc-fn raft-state* server-id message)] + (if-let [msgs (get-in raft-state* [:servers server-id :stats :sent])] + (assoc-in raft-state* [:servers server-id :stats :sent] (inc msgs)) + raft-state*))) raft-state* msg-queue)) raft-state)) diff --git a/src/fluree/raft/log.clj b/src/fluree/raft/log.clj index 0776e90..2dd79f5 100644 --- a/src/fluree/raft/log.clj +++ b/src/fluree/raft/log.clj @@ -89,7 +89,7 @@ (defn move-log "Moves the source log file to destination-file." - [source-file destination-file] + [^File source-file ^File destination-file] (Files/move (.toPath source-file) (.toPath destination-file) (into-array CopyOption [StandardCopyOption/ATOMIC_MOVE StandardCopyOption/REPLACE_EXISTING])))