Merge branch 'develop'
This commit is contained in:
commit
6ffdc8f0b1
|
@ -17,17 +17,6 @@
|
||||||
(let [labels (:labels issue)]
|
(let [labels (:labels issue)]
|
||||||
(some #(= label-name (:name %)) labels)))
|
(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]
|
(defn add-bounty-for-issue [repo repo-id issue]
|
||||||
(let [{issue-id :id
|
(let [{issue-id :id
|
||||||
issue-number :number
|
issue-number :number
|
||||||
|
@ -58,6 +47,18 @@
|
||||||
(issues/update-transaction-hash issue-id transaction-hash))))
|
(issues/update-transaction-hash issue-id transaction-hash))))
|
||||||
(log/debug "Issue already exists in DB, ignoring"))))
|
(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
|
;; We have a max-limit to ensure people can't add more issues and
|
||||||
;; drain bot account until we have economic design in place
|
;; drain bot account until we have economic design in place
|
||||||
;; TODO(oskarth): Update max-limit to 100
|
;; TODO(oskarth): Update max-limit to 100
|
||||||
|
|
Loading…
Reference in New Issue