You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2023/03/29 21:47:51 UTC

[superset] 01/01: add backoff

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

hugh pushed a commit to branch add-backoff-ssh-connection
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 057d7458a393c6fb75309e47539e663be9d89b36
Author: hughhhh <hu...@gmail.com>
AuthorDate: Wed Mar 29 17:47:25 2023 -0400

    add backoff
---
 superset/models/core.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/superset/models/core.py b/superset/models/core.py
index d7a38cdc03..9914f64917 100755
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -20,6 +20,8 @@ import enum
 import json
 import logging
 import textwrap
+import backoff
+import sshtunnel
 from ast import literal_eval
 from contextlib import closing, contextmanager, nullcontext
 from copy import deepcopy
@@ -377,6 +379,7 @@ class Database(
             else None
         )
 
+    @backoff.on_exception(backoff.expo, sshtunnel.BaseSSHTunnelForwarderError, factor=10, base=2, max_tries=5)
     @contextmanager
     def get_sqla_engine_with_context(
         self,