mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
chore: Lower giveup log level for retried functions to warning (#26188)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
import logging
|
||||
from collections.abc import Generator
|
||||
from typing import Any, Callable, Optional
|
||||
|
||||
@@ -26,6 +27,7 @@ def retry_call(
|
||||
*args: Any,
|
||||
strategy: Callable[..., Generator[int, None, None]] = backoff.constant,
|
||||
exception: type[Exception] = Exception,
|
||||
giveup_log_level: int = logging.WARNING,
|
||||
fargs: Optional[list[Any]] = None,
|
||||
fkwargs: Optional[dict[str, Any]] = None,
|
||||
**kwargs: Any
|
||||
@@ -33,6 +35,7 @@ def retry_call(
|
||||
"""
|
||||
Retry a given call.
|
||||
"""
|
||||
kwargs["giveup_log_level"] = giveup_log_level
|
||||
decorated = backoff.on_exception(strategy, exception, *args, **kwargs)(func)
|
||||
fargs = fargs or []
|
||||
fkwargs = fkwargs or {}
|
||||
|
||||
Reference in New Issue
Block a user