This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/add-db-conn-success-log
in repository https://gitbox.apache.org/repos/asf/superset.git

commit f5e75db2aaef269ec8c906d475c272d3944c2903
Author: hughhhh <[email protected]>
AuthorDate: Fri Mar 26 10:12:21 2021 -0400

    add success log whenever a connection is mad
---
 superset/databases/commands/test_connection.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/superset/databases/commands/test_connection.py 
b/superset/databases/commands/test_connection.py
index b6171f1..bb4ef20 100644
--- a/superset/databases/commands/test_connection.py
+++ b/superset/databases/commands/test_connection.py
@@ -114,6 +114,12 @@ class TestConnectionDatabaseCommand(BaseCommand):
             with closing(engine.raw_connection()) as conn:
                 if not engine.dialect.do_ping(conn):
                     raise DBAPIError(None, None, None)
+            
+            # Log succesful connection test with engine
+            event_logger.log_with_context(
+                action=f"test_connection_success",
+                engine=database.db_engine_spec.__name__,
+            )
 
         except (NoSuchModuleError, ModuleNotFoundError) as ex:
             event_logger.log_with_context(

Reply via email to