remove timing logs from get_rss_feed in api_server
This commit is contained in:
@@ -788,7 +788,6 @@ async def get_rss_feed(channel: str,
|
||||
|
||||
while True:
|
||||
try:
|
||||
start_time = time.time()
|
||||
|
||||
if output_type == 'rss':
|
||||
rss_content = await generate_channel_rss(channel,
|
||||
@@ -797,8 +796,6 @@ async def get_rss_feed(channel: str,
|
||||
exclude_flags=exclude_flags,
|
||||
exclude_text=exclude_text,
|
||||
merge_seconds=merge_seconds)
|
||||
elapsed_time = time.time() - start_time
|
||||
logger.info(f"rss_generation_timing: channel {channel}, generated in {elapsed_time:.3f} seconds")
|
||||
return Response(content=rss_content, media_type="application/xml")
|
||||
elif output_type == 'html':
|
||||
rss_content = await generate_channel_html(channel,
|
||||
@@ -807,8 +804,6 @@ async def get_rss_feed(channel: str,
|
||||
exclude_flags=exclude_flags,
|
||||
exclude_text=exclude_text,
|
||||
merge_seconds=merge_seconds)
|
||||
elapsed_time = time.time() - start_time
|
||||
logger.info(f"html_generation_timing: channel {channel}, generated in {elapsed_time:.3f} seconds")
|
||||
return Response(content=rss_content, media_type="text/html")
|
||||
except ValueError as e:
|
||||
error_message = f"invalid_parameters_error: {str(e)}"
|
||||
|
||||
+3
-3
@@ -409,9 +409,9 @@ async def generate_channel_rss(channel: str | int,
|
||||
# Re-raise the original exception to be caught by the outer handler if needed,
|
||||
# but add specific logging here.
|
||||
raise ValueError(f"Failed to get chat info for {channel}: {str(e)}") from e # Raise a more specific error perhaps
|
||||
|
||||
channel_info_elapsed = time.time() - channel_info_start_time
|
||||
logger.info(f"rss_channel_info_timing: channel {channel}, retrieved in {channel_info_elapsed:.3f} seconds")
|
||||
finally:
|
||||
channel_info_elapsed = time.time() - channel_info_start_time
|
||||
logger.info(f"rss_channel_info_timing: channel {channel}, retrieved in {channel_info_elapsed:.3f} seconds")
|
||||
|
||||
# Set feed metadata
|
||||
main_name = f"{channel_title} (@{channel_username})"
|
||||
|
||||
Reference in New Issue
Block a user