diff --git a/handlers/admin/clusters/clusters_handler.py b/handlers/admin/clusters/clusters_handler.py index 77bdfd5b..bc7af8a1 100644 --- a/handlers/admin/clusters/clusters_handler.py +++ b/handlers/admin/clusters/clusters_handler.py @@ -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( diff --git a/handlers/keys/key_mode/key_cluster_mode.py b/handlers/keys/key_mode/key_cluster_mode.py index 509fe40c..1ce962f1 100644 --- a/handlers/keys/key_mode/key_cluster_mode.py +++ b/handlers/keys/key_mode/key_cluster_mode.py @@ -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, diff --git a/handlers/keys/key_mode/key_country_mode.py b/handlers/keys/key_mode/key_country_mode.py index 51df4fd1..c493ed1b 100644 --- a/handlers/keys/key_mode/key_country_mode.py +++ b/handlers/keys/key_mode/key_country_mode.py @@ -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, diff --git a/handlers/notifications/general_notifications.py b/handlers/notifications/general_notifications.py index 9056b55c..cf8aad12 100644 --- a/handlers/notifications/general_notifications.py +++ b/handlers/notifications/general_notifications.py @@ -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