I seem to come across unique situations throughout this month.
I need to read a file from the web and update the database.
I have taken two approaches :
Approach 1.
Upload the values from the application itself - this could be time consuming and I could hit worker timeout - however, I have retained this approach - as it currently takes 27-29 seconds. Heroku timeout is at 30 seconds.
Approach 2.
Upload the values from Django Command Management . I have scheduled a job via Heroku.
I used pandas - pd.read_csv file for reading a file from the web in both approaches.
Scenario 1:
If I use approach 1,
Localhost : It works fine
Heroku : It works fine
Scenario 2 :
If I use approach 2,
Localhost : It works fine
Heroku : HTTP 503 error and not able to read the file
What could be the solution for this ?
P.S. - I plan to put requests and add a browser header and update this thread.