Note that there are some explanatory texts on larger screens.

plurals
  1. POMongoDB Record To Array Takes Forever
    primarykey
    data
    text
    <p>I'm getting information from the database (MongoDB) and then converting it to an array like that:</p> <pre><code> @bs = coll.find("headers.from" =&gt; { "$regex" =&gt; email, "$options" =&gt; 'i' }, "date" =&gt; {"$gte" =&gt; initial_date, "$lte" =&gt; Time.now.utc}) puts "a seguir ao fetch" puts @bs @bs = @bs.to_a </code></pre> <p>This works very well but sometimes, it just enters in an infinite cycle (I believe) because It crashes my heroku app.</p> <p>The response (the first line is the print of @bs):</p> <pre><code>2011-05-14T17:05:46+00:00 app[web.1]: DBResponse(flags=, cursor_id=, start=) 2011-05-14T17:06:16+00:00 heroku[router]: Error H12 (Request timeout) -&gt; GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0 2011-05-14T17:06:47+00:00 heroku[router]: Error H12 (Request timeout) -&gt; GET yapi.heroku.com/favicon.ico dyno=web.1 queue=0 wait=0ms service=0ms bytes=0 2011-05-14T17:07:10+00:00 heroku[router]: Error H12 (Request timeout) -&gt; GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0 2011-05-14T17:07:17+00:00 heroku[router]: Error H12 (Request timeout) -&gt; GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0 2011-05-14T17:07:51+00:00 heroku[router]: Error H12 (Request timeout) -&gt; GET yapi.heroku.com/api/v1/69399ead0ed4ded38e7a101f7c8faf/2011-2-1.json dyno=web.1 queue=0 wait=0ms service=0ms bytes=0 </code></pre> <p>I'd like to know why because I really can't find out why with all the debug information. IT just holds on the ".to_a" forever and the server is blocked.</p> <p>Please help.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload