ruby - Rails 200 status codes change to 302 if a request takes too long? -


i have rails app fires off code assemble large report on users data. takes ages , needs come off external api (salesforce).

i have code works on many records:

  • grabbing data
  • formatting correctly
  • passing view , rendering pdf before refreshing page ajax.

most requests end this:

rendered record_requests/_get_digest.html.erb (2974.9ms) rendered record_requests/get_digest.js.erb (2983.4ms) completed 200 ok in 5957ms (views: 2770.9ms | activerecord: 222.1ms)

which great!

but of largest records can take 6+ minutes grab , process - @ point different occurs: ```

redirected https://[base_url]/record_requests/5 completed 302 found in 288345ms (activerecord: 2.4ms) disaster because redirect seems kick off initial request again stuck in loop...

these 2 requests use same code!! why 1 getting rendered , other getting redirected? there built-in rails timeouts.

soo confused, can shed light on this?

this works via excellent restforce gem,the full gemfile listed here.

the controller looks this:

# /record_requests/1 def show respond_to |format| format.html {} # format.json { head :ok } format.js end end

# /record_requests/1/get_record def get_digest @client = @record_request.client_digest @request_digest = @record_request.build_request_digest respond_to |format| format.js end end

if pretty 600s timeout.

i guess, possible sources are:

  • salesforce itself, althought can't see mention of specific timeout requests
  • the client library use call api, , how handle reponse
  • the webserver host on

of three, it's rails showing redirect - guess it's second one, without details of code , library use, it's hard - depends on how handle errors in method.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -