Forums

504 Timeout

Hey Guys,

My webapp: http://ardiz8.pythonanywhere.com/stocks/?ticker=YHOO scrapes stock data and then performs some calculations on the stock data. The scraping and the calculations take a while to perform so I'm getting a 504 Timeout error. Is there any way to allow my webapp to work longer and not timeout? By replacing "YHOO" with a different stock ticker you can analyze different stocks.

Thanks, ardiz8

That would be tricky, and normally it's a bit odd for a web request to take more than two minutes (the normal time before a 504). Are your calculations particularly time-sensitive? If they're based on daily stock data, you could scrape the numbers in a daily scheduled task (or an hourly one if you upgrade to a Hacker account) and then run the calculations just once.

Thanks dude. I upgraded my account. Thanks again for answering the question so quickly

No problem, and thanks for upgrading :-)