mirror of
https://github.com/juanfont/headscale.git
synced 2026-10-26 08:16:50 +09:00
make configurable wal auto checkpoint (#2242)
This commit is contained in:
1 parent
dc17b4d378
commit
64bb56352f
3 files changed
+14
-6
No files matched your search
+3
-3
@@ -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