bump on-close analysis limit back up to 1000, timeout should prevent long-running

This commit is contained in:
kim 2024-04-18 13:02:53 +01:00
parent 7fddb10d57
commit dea0b2932d
1 changed files with 2 additions and 5 deletions

View File

@ -30,7 +30,6 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/db/sqlite"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/log"
)
var (
@ -253,10 +252,8 @@ func (c *SQLiteConn) Close() (err error) {
old := raw.SetInterrupt(ctx)
// see: https://www.sqlite.org/pragma.html#pragma_optimize
const onClose = "PRAGMA analysis_limit=400; PRAGMA optimize;"
if err := raw.Exec(onClose); err != nil {
log.Error(ctx, "optimize on close error: %v", err)
}
const onClose = "PRAGMA analysis_limit=1000; PRAGMA optimize;"
_ = raw.Exec(onClose)
// Unset timeout context.
_ = raw.SetInterrupt(old)