mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-07-31 14:12:05 +08:00
fix(billing_service): change retry condition to handle specific reque… (#12091)
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: Garfield Dai <dai.hai@foxmail.com>
This commit is contained in:
parent
a1c78ad9d4
commit
017d7538ae
@ -2,7 +2,7 @@ import os
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
from tenacity import retry, retry_if_not_exception_type, stop_before_delay, wait_fixed
|
||||
from tenacity import retry, retry_if_exception_type, stop_before_delay, wait_fixed
|
||||
|
||||
from extensions.ext_database import db
|
||||
from models.account import TenantAccountJoin, TenantAccountRole
|
||||
@ -44,7 +44,7 @@ class BillingService:
|
||||
@retry(
|
||||
wait=wait_fixed(2),
|
||||
stop=stop_before_delay(10),
|
||||
retry=retry_if_not_exception_type(httpx.RequestError),
|
||||
retry=retry_if_exception_type(httpx.RequestError),
|
||||
reraise=True,
|
||||
)
|
||||
def _send_request(cls, method, endpoint, json=None, params=None):
|
||||
|
@ -74,7 +74,7 @@ class FeatureService:
|
||||
|
||||
cls._fulfill_params_from_env(features)
|
||||
|
||||
if dify_config.BILLING_ENABLED:
|
||||
if dify_config.BILLING_ENABLED and tenant_id:
|
||||
cls._fulfill_params_from_billing_api(features, tenant_id)
|
||||
|
||||
return features
|
||||
|
Loading…
x
Reference in New Issue
Block a user