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

Merge branch 'master' into 'master'

5mins timeout for large files

See merge request !16
parents 9ead916b eece614d
...@@ -399,11 +399,13 @@ func worker(i int) { ...@@ -399,11 +399,13 @@ func worker(i int) {
attachment = "" attachment = ""
} }
ctx, cancel := context.WithTimeout(context.Background(), time.Second*50) ctx, cancel := context.WithTimeout(context.Background(), time.Second*300)
defer cancel() defer cancel()
MailgunResp, id, err := mg.Send(ctx, message) MailgunResp, id, err := mg.Send(ctx, message)
mailSentTimeMailgun := time.Now().In(loc).String()
if err != nil { if err != nil {
// log.Fatal(err) // log.Fatal(err)
logmail(subject, sender, recipient, cc, bcc, attachment, readTimeOutbox, mailSentTimeMailgun, id, err.Error(), "", deleteTimeOutbox, mail.ID)
fmt.Printf("MailgunResp err : %s", err.Error()) fmt.Printf("MailgunResp err : %s", err.Error())
alertAdmin(" Mailgun Error \n" + err.Error()) alertAdmin(" Mailgun Error \n" + err.Error())
} }
...@@ -415,7 +417,6 @@ func worker(i int) { ...@@ -415,7 +417,6 @@ func worker(i int) {
fmt.Printf("Email sent ID: %s Resp: %s\n", id, MailgunResp) fmt.Printf("Email sent ID: %s Resp: %s\n", id, MailgunResp)
} }
//sendMessage(mg, sender, subject, body, recipient, cc) //sendMessage(mg, sender, subject, body, recipient, cc)
mailSentTimeMailgun := time.Now().In(loc).String()
/** /**
* add the email as new document in "SENT ITEMS" DB * add the email as new document in "SENT ITEMS" DB
*/ */
......
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