Skip to content

Commit

Permalink
Do not post flow results on :nos/cmd-error
Browse files Browse the repository at this point in the history
  • Loading branch information
jeisses committed Dec 14, 2023
1 parent 047d08d commit 69bf0ab
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nosana_node/nosana.clj
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@
(catch Exception e
[:error {} ["Unexpected error" (ex-message e)]])))

(defn flow-failed?
"Return `true` any results in `_flow` contains a `:nos/error` value."

"Return `true` any results in `_flow` contains a `:nos/error` or a `:nos/cmd-error`."
[{:keys [status state ops] :as _flow}]
(not
(nil?
(some #(= :nos/error (-> % second first)) state))))
(some #(or (= :nos/error (-> % second first))
(= :nos/cmd-error (-> % second first))
) state))))

(defn flow-finished? [flow]
(flow/finished? flow))
Expand Down Expand Up @@ -797,7 +799,7 @@
(defn use-create-ata-and-stake
"Component that creates the NOS ATA and stake account if they don't
exist yet."
[{:nos/keys [conf] :as sys}]
[{:nos/keys [conf] :as sys}]
(when (not (sol/get-account-data (:nos-ata conf) (:network conf)))
(try
(println "> Opening a NOS ATA account")
Expand Down

0 comments on commit 69bf0ab

Please sign in to comment.