Github user d2r commented on a diff in the pull request: https://github.com/apache/storm/pull/838#discussion_r45505075 --- Diff: storm-core/src/clj/backtype/storm/util.clj --- @@ -1062,6 +1062,22 @@ (defn hashmap-to-persistent [^HashMap m] (zipmap (.keySet m) (.values m))) +(defn retry-on-exception + "Retries specific function on exception based on retries count" + [tries task-description f & args] + (let [res (try {:value (apply f args)} + (catch Exception e + (if (= 0 tries) + (throw e) + {:exception e})))] --- End diff -- Probably should check that `tries` is not `pos?`, in case of crazy values of `tries`.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---