Limit max issues to 2

This commit is contained in:
Oskar Thorén 2017-10-31 10:52:52 -05:00
parent 5afaac5b72
commit a912de13c1

View File

@ -48,17 +48,21 @@
(issues/update-transaction-hash issue-id transaction-hash))))
(log/debug "Issue already exists in DB, ignoring"))))
;; 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
(defn add-bounties-for-existing-issues [full-name]
(let [{repo-id :repo_id
owner :owner
repo :repo} (repos/get-repo full-name)
issues (github/get-issues owner repo)
bounty-issues (filter has-bounty-label? issues)]
(log/debug "adding bounties for"
(count bounty-issues) " existing issues")
bounty-issues (filter has-bounty-label? issues)
limit 2
max-bounties (take limit bounty-issues)]
(log/debug (str "adding bounties for" (count bounty-issues)
" existing issues (total " (count bounty-issues) ")"))
(doall
(map (partial add-bounty-for-issue repo repo-id) bounty-issues))))
(map (partial add-bounty-for-issue repo repo-id) max-bounties))))
(defn update-bounty-comment-image [issue-id owner repo issue-number contract-address eth-balance eth-balance-str tokens]