implement email queue
This commit is contained in:
9
main.go
9
main.go
@@ -8,10 +8,17 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const (
|
||||
emailQueueBufferSize = 100
|
||||
maxEmailsPerSecond = 13 // SES allows 14 but I don't want to push it
|
||||
)
|
||||
|
||||
func main() {
|
||||
db := core.NewSqliteDB("nkode.db")
|
||||
defer db.CloseDb()
|
||||
nkodeApi := core.NewNKodeAPI(db)
|
||||
sesClient := core.NewSESClient()
|
||||
emailQueue := core.NewEmailQueue(emailQueueBufferSize, maxEmailsPerSecond, &sesClient)
|
||||
nkodeApi := core.NewNKodeAPI(db, emailQueue)
|
||||
AddDefaultCustomer(nkodeApi)
|
||||
handler := core.NKodeHandler{Api: nkodeApi}
|
||||
mux := http.NewServeMux()
|
||||
|
||||
Reference in New Issue
Block a user