chore(db): cleanup DB in tests and remove OpenTemp (#10282)

Filled up my tmpfs with test DBs when running benchmarks :)
This commit is contained in:
Simon Frei
2025-08-24 09:58:56 +00:00
committed by GitHub
parent a259a009c8
commit e54f51c9c5
13 changed files with 38 additions and 51 deletions
-13
View File
@@ -131,19 +131,6 @@ func OpenForMigration(path string) (*DB, error) {
return db, nil
}
func OpenTemp() (*DB, error) {
// SQLite has a memory mode, but it works differently with concurrency
// compared to what we need with the WAL mode. So, no memory databases
// for now.
dir, err := os.MkdirTemp("", "syncthing-db")
if err != nil {
return nil, wrap(err)
}
path := filepath.Join(dir, "db")
slog.Debug("Test DB", slogutil.FilePath(path))
return Open(path)
}
func (s *DB) Close() error {
s.folderDBsMut.Lock()
defer s.folderDBsMut.Unlock()