mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-06-02 21:39:25 +00:00
release memory on close, return close error
This commit is contained in:
parent
abcdec3196
commit
bb7413ca21
|
@ -272,10 +272,10 @@ func (c *SQLiteConn) QueryContext(ctx context.Context, query string, args []driv
|
|||
func (c *SQLiteConn) Close() (err error) {
|
||||
// see: https://www.sqlite.org/pragma.html#pragma_optimize
|
||||
const onClose = "PRAGMA analysis_limit=1000; PRAGMA optimize;"
|
||||
if r, ok := c.ConnIface.(sqlite3.DriverConn); ok {
|
||||
_ = r.Raw().Exec(onClose)
|
||||
_ = r.Raw().Close()
|
||||
}
|
||||
raw := c.ConnIface.(sqlite3.DriverConn).Raw()
|
||||
_ = raw.Exec(onClose)
|
||||
_ = raw.ReleaseMemory()
|
||||
err = raw.Close()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue