Commit db652549 authored by Stephan Handuwala's avatar Stephan Handuwala 🏋🏻

Merge branch 'master' into 'master'

email changes

See merge request stephan-parkwaylabs/go-email-worker!3
parents 4f678856 b10741dd
couchdb: couchdb:
port: '5984' port: '5984'
host: 0.0.0.0 host: bpapi_default
username: root username: root
password: root password: root
curl: curl:
check_mail: http://root:root@0.0.0.0:5984/outbox/_all_docs/?limit=1 #http://root:root@0.0.0.0:5984/outbox/_all_docs/?limit=1 check_mail: http://root:root@bpapi_default:5984/outbox/_all_docs/?limit=1 #http://root:root@0.0.0.0:5984/outbox/_all_docs/?limit=1
get_outbox_mail: http://root:root@0.0.0.0:5984/outbox/ get_outbox_mail: http://root:root@bpapi_default:5984/outbox/
delete_outbox_mail: http://root:root@0.0.0.0:5984/outbox/ delete_outbox_mail: http://root:root@bpapi_default:5984/outbox/
add_sent_mail: http://root:root@0.0.0.0:5984/sentitems/ add_sent_mail: http://root:root@bpapi_default:5984/sentitems/
add_mail_log: http://root:root@0.0.0.0:5984/mail_logs/ add_mail_log: http://root:root@bpapi_default:5984/mail_logs/
protocols: protocols:
method: http:// method: http://
requests: requests:
......
...@@ -139,15 +139,18 @@ func main() { ...@@ -139,15 +139,18 @@ func main() {
*/ */
req, reqErr := http.NewRequest(config.Requests.Get, config.Curl.CheckMail, nil) req, reqErr := http.NewRequest(config.Requests.Get, config.Curl.CheckMail, nil)
//req, reqErr := http.NewRequest("GET", "http://root:root@0.0.0.0:5984/outbox/_all_docs/?limit=1", nil) //req, reqErr := http.NewRequest("GET", "http://root:root@0.0.0.0:5984/outbox/_all_docs/?limit=1", nil)
req.Header.Set(config.Requests.HeaderType, config.Requests.HeaderJson)
resp, respErr := http.DefaultClient.Do(req)
if reqErr != nil { if reqErr != nil {
alert := " Error creating request to OUTBOX DB \n" + reqErr.Error() alert := " Error creating request to OUTBOX DB \n" + reqErr.Error()
alertAdmin(alert) alertAdmin(alert)
panic(reqErr)
} }
req.Header.Set(config.Requests.HeaderType, config.Requests.HeaderJson)
resp, respErr := http.DefaultClient.Do(req)
if respErr != nil { if respErr != nil {
alert := " Error in getting email from the OUTBOX DB \n" + respErr.Error() alert := " Error in getting email from the OUTBOX DB \n" + respErr.Error()
alertAdmin(alert) alertAdmin(alert)
panic(respErr)
} }
defer resp.Body.Close() defer resp.Body.Close()
respbody, _ := ioutil.ReadAll(resp.Body) respbody, _ := ioutil.ReadAll(resp.Body)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment