Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 31, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original issue description:

See error logs

5:44 PM
[2025-07-31 17:44:36 +0800] [1586311] [INFO] Worker initialized
python3
5:44 PM
[2025-07-31 17:44:36 +0800] [1586311] [INFO] Booting worker with pid: 1586311
python3
5:44 PM
[2025-07-31 17:44:36 +0800] [1585362] [INFO] Worker spawned (pid: [booting])
python3
5:44 PM
[2025-07-31 17:44:36 +0800] [1585366] [INFO] Worker exiting (pid: 1585366)
python3
5:44 PM
127.0.0.1 - - [31/Jul/2025:17:44:36 +0800] "GET /api/download/36 HTTP/1.1" 500 0 "-" "-"
python3
5:44 PM
SystemExit: 1
python3
5:44 PM
sys.exit(1)
python3
5:44 PM
File "/home/josh/.local/lib/python3.12/site-packages/gunicorn/workers/base.py", line 204, in handle_abort
python3
5:44 PM
time.sleep(sleep_time)
python3
5:44 PM
File "/mnt/data/AFHArchive/app/utils/rate_limiter.py", line 38, in read
python3
5:44 PM
^^^^^^^^^^^^^^^^^^^^^^^^
python3
5:44 PM
chunk = limited_file.read(65536)
python3
5:44 PM
File "/mnt/data/AFHArchive/app/routes/api.py", line 50, in generate
python3
5:44 PM
for item in iterable:
python3
5:44 PM
File "/home/josh/.local/lib/python3.12/site-packages/werkzeug/wrappers/response.py", line 32, in _iter_encoded
python3
5:44 PM
^^^^^^^^^^^^
python3
5:44 PM
return self._next()
python3
5:44 PM
File "/home/josh/.local/lib/python3.12/site-packages/werkzeug/wsgi.py", line 256, in __next__
python3
5:44 PM
for item in respiter:
python3
5:44 PM
File "/home/josh/.local/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 182, in handle_request
python3
5:44 PM
self.handle_request(listener, req, client, addr)
python3
5:44 PM
File "/home/josh/.local/lib/python3.12/site-packages/gunicorn/workers/sync.py", line 134, in handle
python3
5:44 PM
Traceback (most recent call last):
python3
5:44 PM
[2025-07-31 17:44:36 +0800] [1585366] [ERROR] Error handling request /api/download/36
python3
5:44 PM
127.0.0.1 - - [31/Jul/2025:17:44:36 +0800] "GET /api/download/36 HTTP/1.1" 200 49414144 "https://afh.joshattic.us/file/36" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36"
python3

This is caused by server handling downloads synchronously, we need to do them asyncronously

Fixes #8.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloads taking longer than ~20s cause server to crash

2 participants