implement sqlite write queue
This commit is contained in:
9
main.go
9
main.go
@@ -6,15 +6,20 @@ import (
|
||||
"go-nkode/core"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
emailQueueBufferSize = 100
|
||||
maxEmailsPerSecond = 13 // SES allows 14 but I don't want to push it
|
||||
maxEmailsPerSecond = 13 // SES allows 14, but I don't want to push it
|
||||
)
|
||||
|
||||
func main() {
|
||||
db := core.NewSqliteDB("nkode.db")
|
||||
dbPath := os.Getenv("SQLITE_DB")
|
||||
if dbPath == "" {
|
||||
log.Fatalf("SQLITE_DB=/path/to/nkode.db not set")
|
||||
}
|
||||
db := core.NewSqliteDB(dbPath)
|
||||
defer db.CloseDb()
|
||||
sesClient := core.NewSESClient()
|
||||
emailQueue := core.NewEmailQueue(emailQueueBufferSize, maxEmailsPerSecond, &sesClient)
|
||||
|
||||
Reference in New Issue
Block a user