implement email queue

This commit is contained in:
2024-10-06 09:57:29 -05:00
parent a95c0ed9b0
commit bb915f8f0a
19 changed files with 270 additions and 46 deletions

View File

@@ -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()