fix: sync delays / tariff name display
This commit is contained in:
@@ -663,6 +663,8 @@ async def handle_sync_cluster(
|
||||
session=session,
|
||||
remnawave_link=key["remnawave_link"],
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.1)
|
||||
|
||||
else:
|
||||
await delete_key_from_cluster(
|
||||
@@ -686,8 +688,8 @@ async def handle_sync_cluster(
|
||||
session=session,
|
||||
remnawave_link=key["remnawave_link"],
|
||||
)
|
||||
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
await asyncio.sleep(0.5)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
|
||||
@@ -197,14 +197,7 @@ async def key_cluster_mode(
|
||||
device_limit=TRIAL_CONFIG.get("hwid_limit", 1)
|
||||
)
|
||||
else:
|
||||
tariff_duration = ""
|
||||
if tariff_info and tariff_info.get("duration_days", 0) > 0:
|
||||
duration_days = tariff_info["duration_days"]
|
||||
if duration_days >= 30:
|
||||
months = duration_days // 30
|
||||
tariff_duration = format_months(months)
|
||||
else:
|
||||
tariff_duration = format_days(duration_days)
|
||||
tariff_duration = tariff_info["name"]
|
||||
|
||||
key_message_text = key_message_success(
|
||||
final_link,
|
||||
|
||||
@@ -569,14 +569,7 @@ async def finalize_key_creation(
|
||||
device_limit=TRIAL_CONFIG.get("hwid_limit", 1)
|
||||
)
|
||||
else:
|
||||
tariff_duration = ""
|
||||
if tariff_info and tariff_info.get("duration_days", 0) > 0:
|
||||
duration_days = tariff_info["duration_days"]
|
||||
if duration_days >= 30:
|
||||
months = duration_days // 30
|
||||
tariff_duration = format_months(months)
|
||||
else:
|
||||
tariff_duration = format_days(duration_days)
|
||||
tariff_duration = tariff_info["name"]
|
||||
|
||||
key_message_text = key_message_success(
|
||||
link_to_show,
|
||||
|
||||
@@ -580,13 +580,7 @@ async def process_auto_renew_or_notify(
|
||||
client_id = key.client_id
|
||||
current_expiry = key.expiry_time
|
||||
duration_days = selected_tariff["duration_days"]
|
||||
tariff_duration = ""
|
||||
if duration_days > 0:
|
||||
if duration_days >= 30:
|
||||
months = duration_days // 30
|
||||
tariff_duration = format_months(months)
|
||||
else:
|
||||
tariff_duration = format_days(duration_days)
|
||||
tariff_duration = selected_tariff["name"]
|
||||
renewal_cost = selected_tariff["price_rub"]
|
||||
traffic_limit = selected_tariff["traffic_limit"]
|
||||
device_limit = selected_tariff["device_limit"]
|
||||
@@ -627,7 +621,7 @@ async def process_auto_renew_or_notify(
|
||||
await delete_notification(conn, tg_id, notification_id)
|
||||
|
||||
renewed_message = get_renewal_message(
|
||||
tariff_name=tariff_duration,
|
||||
tariff_name=selected_tariff["name"],
|
||||
traffic_limit=selected_tariff.get("traffic_limit") if selected_tariff.get("traffic_limit") is not None else 0,
|
||||
device_limit=selected_tariff.get("device_limit") if selected_tariff.get("device_limit") is not None else 0,
|
||||
expiry_date=formatted_expiry_date
|
||||
|
||||
Reference in New Issue
Block a user