Skip to content

Commit

Permalink
remove redundant reconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Apr 13, 2024
1 parent 6374710 commit 3e3ad81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions scalardb/src/scalardb/transfer.clj
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
"Execute transfers in parallel. Give the transfer function."
[test op transfer-fn]
(let [results (pmap #(transfer-fn test %) (:value op))]
(when (every? :start-fail results)
(scalar/try-reconnection! test scalar/prepare-transaction-service!))
(if (some #{:commit} results)
;; return :ok when at least 1 transaction is committed
(assoc op :type :ok :value {:results results})
Expand Down Expand Up @@ -192,7 +190,7 @@
(defn transfer
[test _]
(let [num-accs (-> test :client :n)
num-txs (inc (rand-int (-> test :client :max-txs)))]
num-txs (-> test :client :max-txs rand-int inc)]
{:type :invoke
:f :transfer
:value (repeatedly num-txs
Expand Down
5 changes: 3 additions & 2 deletions scalardb/src/scalardb/transfer_append.clj
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@
:age (get-ages results)
:num (get-nums results)})
(assoc op :type, :fail, :error "Failed to get all records")))
:check-tx (if-let [num-committed (scalar/check-transaction-states test
@(:unknown-tx test))]
:check-tx (if-let [num-committed (scalar/check-transaction-states
test
@(:unknown-tx test))]
(assoc op :type :ok, :value num-committed)
(assoc op :type :fail, :error "Failed to check status"))))

Expand Down

0 comments on commit 3e3ad81

Please sign in to comment.