fix(api): Add logfiles to gitignore, remove debug code

This commit is contained in:
TheOnlyWayUp
2024-11-30 21:14:21 +00:00
parent 26b9db8945
commit 8b00d0b109
4 changed files with 1 additions and 33 deletions
+1
View File
@@ -7,3 +7,4 @@ build
.vscode
.venv
.env
*log
-1
View File
@@ -177,7 +177,6 @@ async def fetch_story_id(
@backoff.on_exception(backoff.expo, ClientResponseError, max_time=15)
async def retrieve_story(story_id: int, cookies: Optional[dict] = None) -> dict:
"""Taking a story_id, return its information from the Wattpad API."""
print("using cache", None if cookies else cache)
with start_action(action_type="api_fetch_story", story_id=story_id):
async with CachedSession(
headers=headers, cookies=cookies, cache=None if cookies else cache
-1
View File
@@ -156,7 +156,6 @@ async def handle_download(
async for title in add_chapters(
book, metadata, download_images=download_images, cookies=cookies
):
print(title)
...
# Book is compiled
-31
View File
@@ -1,31 +0,0 @@
import asyncio
from datetime import datetime
import aiohttp
from rich import print
PORT: int = 8086
DOWNLOAD_URL = (
f"http://localhost:{PORT}/download/314175600?om=1&download_images=true&mode=story"
)
async def fetch(task_id: int, session: aiohttp.ClientSession):
print("started", task_id)
start = datetime.now()
async with session.get(DOWNLOAD_URL) as response:
print(task_id, response.status)
end = datetime.now()
print("time taken", (end - start).total_seconds())
async def main():
session = aiohttp.ClientSession()
await asyncio.gather(*[fetch(i, session) for i in range(30)])
if __name__ == "__main__":
asyncio.run(main())