Merge pull request #13840 from AlanCoding/one_less_connection

Get rid of 1 perpetually unused connection in our app
This commit is contained in:
Hao Liu 2023-04-12 09:30:51 -04:00 committed by GitHub
commit b80d0ae85b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,7 @@ class Command(BaseCommand):
try:
executor = MigrationExecutor(connection)
migrating = bool(executor.migration_plan(executor.loader.graph.leaf_nodes()))
connection.close() # Because of async nature, main loop will use new connection, so close this
except Exception as exc:
logger.warning(f'Error on startup of run_wsrelay (error: {exc}), retry in 10s...')
time.sleep(10)