minor fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
:scheme "https"
|
:scheme "https"
|
||||||
:jwt-secret "auto ap invoices are awesome"
|
:jwt-secret "auto ap invoices are awesome"
|
||||||
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
|
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
|
||||||
:requests-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-requests-prod"
|
:requests-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-prod"
|
||||||
:invoice-email "invoices@mail.app.integreatconsult.com"
|
:invoice-email "invoices@mail.app.integreatconsult.com"
|
||||||
:data-bucket "data.prod.app.integreatconsult.com"
|
:data-bucket "data.prod.app.integreatconsult.com"
|
||||||
:yodlee-cobrand-name "qstartus12"
|
:yodlee-cobrand-name "qstartus12"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
:scheme "https"
|
:scheme "https"
|
||||||
:jwt-secret "auto ap invoices are awesome"
|
:jwt-secret "auto ap invoices are awesome"
|
||||||
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
|
:invoice-import-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-mail-prod"
|
||||||
:requests-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-requests-prod"
|
:requests-queue-url "https://sqs.us-east-1.amazonaws.com/679918342773/integreat-background-request-prod"
|
||||||
:invoice-email "invoices@mail.app.integreatconsult.com"
|
:invoice-email "invoices@mail.app.integreatconsult.com"
|
||||||
:data-bucket "data.prod.app.integreatconsult.com"
|
:data-bucket "data.prod.app.integreatconsult.com"
|
||||||
:yodlee-cobrand-name "qstartus12"
|
:yodlee-cobrand-name "qstartus12"
|
||||||
|
|||||||
@@ -8,10 +8,13 @@
|
|||||||
[auto-ap.intuit.import :as i]
|
[auto-ap.intuit.import :as i]
|
||||||
[unilog.context :as lc]))
|
[unilog.context :as lc]))
|
||||||
|
|
||||||
|
(def queue-url (:requests-queue-url env))
|
||||||
|
|
||||||
(defn process-1 []
|
(defn process-1 []
|
||||||
(lc/with-context {:source "Request poller"}
|
(lc/with-context {:source "Request poller"}
|
||||||
(log/info "Checking SQS...")
|
(log/info "Checking SQS...")
|
||||||
(let [[{:keys [message-id receipt-handle body]}] (:messages (sqs/receive-message {:queue-url (:requests-queue-url env)
|
(let [[{:keys [message-id receipt-handle body]}] (:messages (sqs/receive-message {:queue-url queue-url
|
||||||
|
:wait-time-seconds 1
|
||||||
:count 1}))]
|
:count 1}))]
|
||||||
(when message-id
|
(when message-id
|
||||||
(log/infof "processing message %s with body %s" message-id body )
|
(log/infof "processing message %s with body %s" message-id body )
|
||||||
@@ -20,7 +23,7 @@
|
|||||||
(i/upsert-transactions)
|
(i/upsert-transactions)
|
||||||
(catch Exception e
|
(catch Exception e
|
||||||
(log/error e))))
|
(log/error e))))
|
||||||
(sqs/delete-message {:queue-url (:requests-queue-url env)
|
(sqs/delete-message {:queue-url queue-url
|
||||||
:receipt-handle receipt-handle} )))))
|
:receipt-handle receipt-handle} )))))
|
||||||
|
|
||||||
(defn fake-message []
|
(defn fake-message []
|
||||||
@@ -28,5 +31,5 @@
|
|||||||
:message-body ":intuit"} ))
|
:message-body ":intuit"} ))
|
||||||
|
|
||||||
(mount/defstate request-listener
|
(mount/defstate request-listener
|
||||||
:start (scheduler/every (* 1000 5) process-1)
|
:start (scheduler/every (* 1000 30) process-1)
|
||||||
:stop (scheduler/stop request-listener))
|
:stop (scheduler/stop request-listener))
|
||||||
|
|||||||
Reference in New Issue
Block a user