ids为空时不需要执行
This commit is contained in:
parent
2032ce8a3c
commit
5d4a3d8235
|
@ -225,6 +225,8 @@ class News < ActiveRecord::Base
|
||||||
vs << {course_message_type:'News',course_message_id:self.id, :user_id => m.user_id,
|
vs << {course_message_type:'News',course_message_id:self.id, :user_id => m.user_id,
|
||||||
:course_id => self.course_id, :viewed => false}
|
:course_id => self.course_id, :viewed => false}
|
||||||
|
|
||||||
|
#delayed_job卡住的原因是一次执行的条数太多,导致超时。
|
||||||
|
#现在把每次只执行不超过30条,就不会超了。
|
||||||
if vs.size >= 30
|
if vs.size >= 30
|
||||||
self.delay.contain_news_message(vs)
|
self.delay.contain_news_message(vs)
|
||||||
vs.clear
|
vs.clear
|
||||||
|
|
Loading…
Reference in New Issue