Skip to content

Commit

Permalink
fix: Drop tenacity retry around connect
Browse files Browse the repository at this point in the history
Wrapping retry for essentially *all* exceptions can lead to repeated
failures which will not magically be handled. retry should be instead
used more cautiously only for known failures.
  • Loading branch information
gavindsouza committed Mar 22, 2024
1 parent 2a745cc commit e16f0a8
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import frappe
from sqlalchemy.sql import text
from tenacity import retry, retry_if_exception_type, stop_after_attempt, wait_fixed

from insights.insights.doctype.insights_table_import.insights_table_import import (
InsightsTableImport,
Expand Down Expand Up @@ -88,12 +87,6 @@ def test_connection(self):
res = connection.execute(text("SELECT 1"))
return res.fetchone()

@retry(
retry=retry_if_exception_type((DatabaseParallelConnectionError,)),
stop=stop_after_attempt(5),
wait=wait_fixed(1),
reraise=True,
)
def connect(self):
try:
return self.engine.connect()
Expand Down

0 comments on commit e16f0a8

Please sign in to comment.