X-Git-Url: https://code.octet-stream.net/broadcaster/blobdiff_plain/d14180328760fa282068927068ca5675b9427bc2..f316c6a23317701ae9fe2c097c55140dea655cfc:/server/database.go diff --git a/server/database.go b/server/database.go index e6ce752..d6bbf92 100644 --- a/server/database.go +++ b/server/database.go @@ -21,10 +21,19 @@ func InitDatabase() { } db.sqldb = sqldb + _, err = db.sqldb.Exec("PRAGMA journal_mode = WAL") + if err != nil { + log.Fatal(err) + } + _, err = db.sqldb.Exec("PRAGMA foreign_keys = ON") if err != nil { - log.Printf("%q\n", err) - return + log.Fatal(err) + } + + _, err = db.sqldb.Exec("PRAGMA busy_timeout = 5000") + if err != nil { + log.Fatal(err) } sqlStmt := `