Remove unneeded args from deploy-contract fn

This commit is contained in:
Vitaliy Vlasov 2018-04-30 14:17:42 +03:00
parent 2ee5af98eb
commit 4ca3fcb833
2 changed files with 8 additions and 11 deletions

View File

@ -22,7 +22,7 @@
(let [labels (:labels issue)] (let [labels (:labels issue)]
(some #(= label-name (:name %)) labels))) (some #(= label-name (:name %)) labels)))
(defn deploy-contract [owner owner-address repo issue-id issue-number] (defn deploy-contract [owner-address issue-id]
(if (empty? owner-address) (if (empty? owner-address)
(log/errorf "issue %s: Unable to deploy bounty contract because repo owner has no Ethereum addres" issue-id) (log/errorf "issue %s: Unable to deploy bounty contract because repo owner has no Ethereum addres" issue-id)
(try (try
@ -47,7 +47,7 @@
(log/debug "issue %s: Adding bounty for issue %s/%s - owner address: %s" (log/debug "issue %s: Adding bounty for issue %s/%s - owner address: %s"
issue-id repo issue-number owner-address) issue-id repo issue-number owner-address)
(if (= 1 created-issue) (if (= 1 created-issue)
(deploy-contract owner owner-address repo issue-id issue-number) (deploy-contract owner-address issue-id)
(log/debug "issue %s: Issue already exists in DB, ignoring")))) (log/debug "issue %s: Issue already exists in DB, ignoring"))))
(defn maybe-add-bounty-for-issue [repo repo-id issue] (defn maybe-add-bounty-for-issue [repo repo-id issue]

View File

@ -94,13 +94,10 @@
[] []
(p :deploy-pending-contracts (p :deploy-pending-contracts
(doseq [{issue-id :issue_id (doseq [{issue-id :issue_id
issue-number :issue_number owner-address :owner_address} (db-bounties/pending-contracts)]
owner :owner
owner-address :owner_address
repo :repo} (db-bounties/pending-contracts)]
(log/infof "issue %s: Trying to re-deploy failed bounty contract deployment" issue-id) (log/infof "issue %s: Trying to re-deploy failed bounty contract deployment" issue-id)
(try (try
(bounties/deploy-contract owner owner-address repo issue-id issue-number) (bounties/deploy-contract owner-address issue-id)
(catch Throwable t (catch Throwable t
(log/errorf t "issue %s: deploy-pending-contracts exception: %s" issue-id (ex-data t))))))) (log/errorf t "issue %s: deploy-pending-contracts exception: %s" issue-id (ex-data t)))))))
@ -436,11 +433,11 @@
(mount/defstate scheduler (mount/defstate scheduler
:start (let [every-minute (rest :start (let [every-minute (rest
(periodic-seq (t/now) (periodic-seq (t/now)
(t/minutes 1))) (t/minutes 1)))
every-10-minutes (rest every-10-minutes (rest
(periodic-seq (t/now) (periodic-seq (t/now)
(t/minutes 10))) (t/minutes 10)))
error-handler (fn [e] error-handler (fn [e]
(log/error "Scheduled task failed" e) (log/error "Scheduled task failed" e)
(throw e)) (throw e))