mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-11 15:27:37 +00:00
make configurable wal auto checkpoint (#2242)
This commit is contained in:
@@ -543,10 +543,10 @@ func openDB(cfg types.DatabaseConfig) (*gorm.DB, error) {
|
||||
}
|
||||
|
||||
if cfg.Sqlite.WriteAheadLog {
|
||||
if err := db.Exec(`
|
||||
if err := db.Exec(fmt.Sprintf(`
|
||||
PRAGMA journal_mode=WAL;
|
||||
PRAGMA wal_autocheckpoint=0;
|
||||
`).Error; err != nil {
|
||||
PRAGMA wal_autocheckpoint=%d;
|
||||
`, cfg.Sqlite.WALAutoCheckPoint)).Error; err != nil {
|
||||
return nil, fmt.Errorf("setting WAL mode: %w", err)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user