db performance

This commit is contained in:
2026-11-24 13:29:27 -05:00
parent 0dc689d1a6
commit 975ca4f6ed
3 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -25,4 +25,6 @@
# !Makefile # !Makefile
# ...even if they are in subdirectories # ...even if they are in subdirectories
!*/ !*/
/tmp/**
+3
View File
@@ -56,6 +56,9 @@ func InitDatabase(path string) (*gorm.DB, error) {
if err := db.Exec("PRAGMA foreign_keys = ON").Error; err != nil { if err := db.Exec("PRAGMA foreign_keys = ON").Error; err != nil {
return nil, fmt.Errorf("enable foreign keys: %w", err) return nil, fmt.Errorf("enable foreign keys: %w", err)
} }
if err := db.Exec("PRAGMA synchronous = NORMAL").Error; err != nil {
return nil, fmt.Errorf("set synchronous normal: %w", err)
}
if err := db.AutoMigrate(&Upload{}, &Report{}); err != nil { if err := db.AutoMigrate(&Upload{}, &Report{}); err != nil {
migrationErr := fmt.Errorf("migrate database: %w", err) migrationErr := fmt.Errorf("migrate database: %w", err)
+1 -1
View File
@@ -27,7 +27,7 @@ goals:
- auth options - auth options
- user & pass - user & pass
- cloudflare access - cloudflare access
- ~~local access from a specifc ip or range only~~ - local access from a specifc ip or range only
- [x] ASN blocking via geolite2 - [x] ASN blocking via geolite2
- [x] upload endpoint - [x] upload endpoint