Comments about sqlite: take mysql into account too

This commit is contained in:
Klaas van Schelven
2024-08-28 15:40:06 +02:00
parent 4e613a943e
commit 6bb853cd22
2 changed files with 6 additions and 4 deletions

View File

@@ -145,8 +145,11 @@ DATABASES = {
DATABASE_ROUTERS = ("bugsink.dbrouters.SeparateSnappeaDBRouter",)
# This is the default, but we're being explicit. In our setup (sqlite) we assume a low cost for reconnecting to the DB,
# but a potential high cost ("checkpoint starvation") for keeping connections open.
# This is the default, but we're being explicit. In our recommended setup (sqlite) we assume a low cost for reconnecting
# to the DB, but a potential high cost ("checkpoint starvation") for keeping connections open.
#
# For not-as-recommended setups (mysql) we're OK with "one connection per request" too, even though the arguments laid
# out in the above don't apply as much. (This might change after research)
CONN_MAX_AGE = 0

View File

@@ -32,8 +32,7 @@ logger = logging.getLogger("bugsink")
def set_wal_pragma(apps, schema_editor):
# even though we're currently on "sqlite only", we take the forward-looking approach of at least having the escape
# hatch for other DBs:
# for non-sqlite (i.e. mysql) databases, this set is simply skipped.
if not schema_editor.connection.vendor == 'sqlite':
logger.info('\n Migration info: Database vendor: {}'.format(schema_editor.connection.vendor))
logger.info(' Migration info: Skipping set_wal migration')