mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Database connection pool refactor (#5274)
* Move optimise out of RunAllMigrations * Separate read and write database connections * Enforce readonly connection constraint * Fix migrations not using tx * #5155 - allow setting cache size from environment * Document new environment variable
This commit is contained in:
@@ -247,7 +247,7 @@ func (m *schema45Migrator) insertImage(data []byte, id int, destTable string, de
|
||||
func (m *schema45Migrator) dropTable(ctx context.Context, table string) error {
|
||||
if err := m.withTxn(ctx, func(tx *sqlx.Tx) error {
|
||||
logger.Debugf("Dropping %s", table)
|
||||
_, err := m.db.Exec(fmt.Sprintf("DROP TABLE `%s`", table))
|
||||
_, err := tx.Exec(fmt.Sprintf("DROP TABLE `%s`", table))
|
||||
return err
|
||||
}); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user