异步任务的处理

dev_cs
cxt 5 years ago
parent be63d6d1f7
commit e1cda8ee61

@ -326,7 +326,7 @@ class GraduationTasksController < ApplicationController
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if
@course.end_date.present? && params[:end_time] > @course.end_date.end_of_day
ActiveRecord::Base.transaction do
# ActiveRecord::Base.transaction do
begin
tasks = @course.graduation_tasks.where(id: params[:task_ids], status: 0).
where("publish_time is null or publish_time > '#{Time.now}'")
@ -350,7 +350,7 @@ class GraduationTasksController < ApplicationController
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end
# end
end
def end_task

Loading…
Cancel
Save