如何运行繁重的查询?

时间:2014-05-04 12:39:27

标签: postgresql activerecord heroku ruby-on-rails-4

我正在尝试销毁所有user_id等于nil的实验

Experiment.destroy_all(:user_id=>nil)

但是,这需要很长时间,最终导致应用程序错误

 ERROR -- : worker=1 PID:14 timeout (16s > 15s), killing
2014-05-04T12:31:39.478999+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path=/en/experiments host=dcaclab.com request_id=908575f9-3dcf-47da-8f53-a22fe4f8f48c fwd="86.108.98.180" dyno=web.1 connect=4ms service=15549ms status=503 bytes=0
2014-05-04T12:31:39.479594+00:00 app[web.1]: E, [2014-05-04T12:31:39.479439 #2] ERROR -- : reaped #<Process::Status: pid 14 SIGKILL (signal 9)> worker=1

那么,如何运行这样的查询呢? 另外,如何使用heroku命令行运行它?

0 个答案:

没有答案