chore: add success log whenever a connection is working (#13811)

This commit is contained in:
Hugh A. Miles II 2021-03-29 13:22:09 -04:00 committed by GitHub
parent 9fa52b50ed
commit 9f53c6c5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,12 @@ class TestConnectionDatabaseCommand(BaseCommand):
if not engine.dialect.do_ping(conn):
raise DBAPIError(None, None, None)
# Log succesful connection test with engine
event_logger.log_with_context(
action="test_connection_success",
engine=database.db_engine_spec.__name__,
)
except (NoSuchModuleError, ModuleNotFoundError) as ex:
event_logger.log_with_context(
action=f"test_connection_error.{ex.__class__.__name__}",