enter image description here
I’m developing a model for information analysis, utilizing a Flask-based Fetch API with a React frontend. However, whenever I attempt to invoke it, I encounter the error depicted in the image linked here. I’m seeking advice on whether upgrading my hardware—specifically RAM or CPU—might resolve this issue, or if there are alternative solutions.
The processing time for information analysis typically ranges from one to five minutes.
I tried implementing timeout for each call but it still did not work!
import signal
import logging
# Custom timeout exception
class TimeoutException(Exception):
pass
def _handle_timeout(signum, frame):
raise TimeoutException("Function call timed out")
signal.alarm(300) # Set timeout to 5 minutes (300 seconds)
Oluwafisayo Adabs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.