Skip to content

Commit

Permalink
disable sqlite pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Jan 2, 2025
1 parent 834e60b commit ebb430f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ func migrateSamples(ctx context.Context, opts options, samplesDB *storage.Sample
}
migrateSamples := func(file string, sampleType storage.SampleType, origin storage.SampleOrigin) (*storage.SamplesStats, error) {
if _, err := os.Stat(file); err != nil {
log.Printf("[DEBUG] samples file %s not found, err: %v, skip", file, err)
log.Printf("[DEBUG] samples file %s not found, skip", file)
return &storage.SamplesStats{}, nil
}
fh, err := os.Open(file) //nolint:gosec // file path is controlled by the app
Expand Down
10 changes: 5 additions & 5 deletions app/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ func (e *Engine) MakeLock() RWLocker {
}

func setSqlitePragma(db *sqlx.DB) error {
// set pragmas for better concurrency support
// set pragmas for sqlite
pragmas := map[string]string{
"journal_mode": "WAL",
"synchronous": "NORMAL",
"busy_timeout": "5000",
"foreign_keys": "ON",
// "journal_mode": "WAL",
// "synchronous": "NORMAL",
// "busy_timeout": "5000",
// "foreign_keys": "ON",
}

// set pragma
Expand Down

0 comments on commit ebb430f

Please sign in to comment.