db performance
This commit is contained in:
@@ -26,3 +26,5 @@
|
|||||||
|
|
||||||
# ...even if they are in subdirectories
|
# ...even if they are in subdirectories
|
||||||
!*/
|
!*/
|
||||||
|
|
||||||
|
/tmp/**
|
||||||
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user