diff --git a/src/clj/commiteth/bounties.clj b/src/clj/commiteth/bounties.clj index 98c5da0..82a940e 100644 --- a/src/clj/commiteth/bounties.clj +++ b/src/clj/commiteth/bounties.clj @@ -17,17 +17,6 @@ (let [labels (:labels issue)] (some #(= label-name (:name %)) labels))) -;; TODO: Change max-limit, also defined in two places -(defn maybe-add-bounty-for-issue [repo repo-id issue] - (let [res (issues/get-issues-count repo-id) - {issues-count :count} res - max-limit 2 - limit-reacted? (> issues-count max-limit) - _ log/debug ("*** get-issues-count" repo-id res count limit-reached?)] - (if limit-reached? - (log/debug "Total issues for repo limit reached " repo issues-count) - (add-bounty-for-issue repo repo-id issue)))) - (defn add-bounty-for-issue [repo repo-id issue] (let [{issue-id :id issue-number :number @@ -58,6 +47,18 @@ (issues/update-transaction-hash issue-id transaction-hash)))) (log/debug "Issue already exists in DB, ignoring")))) +;; TODO: Change max-limit, also defined in two places +(defn maybe-add-bounty-for-issue [repo repo-id issue] + (let [res (issues/get-issues-count repo-id) + {count :count} res + max-limit 2 + limit-reached? (> count max-limit) + _ (log/debug "*** get-issues-count" repo-id res count limit-reached?)] + (if limit-reached? + (log/debug "Total issues for repo limit reached " repo count) + (add-bounty-for-issue repo repo-id issue)))) + + ;; We have a max-limit to ensure people can't add more issues and ;; drain bot account until we have economic design in place ;; TODO(oskarth): Update max-limit to 100