update aggregation logic
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -338,13 +339,18 @@ func ApplySQLiteTuning(ctx context.Context, dbConn *sqlx.DB) {
|
||||
return
|
||||
}
|
||||
// Best-effort pragmas; ignore errors to stay safe in constrained environments.
|
||||
var err error
|
||||
pragmas := []string{
|
||||
`PRAGMA journal_mode=WAL;`,
|
||||
`PRAGMA synchronous=NORMAL;`,
|
||||
`PRAGMA temp_store=MEMORY;`,
|
||||
`PRAGMA optimize;`,
|
||||
}
|
||||
for _, pragma := range pragmas {
|
||||
_, _ = dbConn.ExecContext(ctx, pragma)
|
||||
_, err = dbConn.ExecContext(ctx, pragma)
|
||||
if logger, ok := ctx.Value("logger").(*slog.Logger); ok && logger != nil {
|
||||
logger.Debug("Applied SQLite tuning pragma", "pragma", pragma, "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user