rake中加打印日志
This commit is contained in:
parent
f2f9792203
commit
5aab3fdb75
|
@ -3,6 +3,7 @@
|
||||||
namespace :homework_publishtime do
|
namespace :homework_publishtime do
|
||||||
desc "start publish homework and end homework"
|
desc "start publish homework and end homework"
|
||||||
task :publish => :environment do
|
task :publish => :environment do
|
||||||
|
puts "--------------------------------homework_publish start"
|
||||||
homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'")
|
homework_commons = HomeworkCommon.where("publish_time = '#{Date.today}'")
|
||||||
homework_commons.each do |homework|
|
homework_commons.each do |homework|
|
||||||
homework_detail_manual = homework.homework_detail_manual
|
homework_detail_manual = homework.homework_detail_manual
|
||||||
|
@ -35,6 +36,7 @@ namespace :homework_publishtime do
|
||||||
Mailer.run.homework_added(homework)
|
Mailer.run.homework_added(homework)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
puts "--------------------------------homework_publish end"
|
||||||
end
|
end
|
||||||
|
|
||||||
task :end => :environment do
|
task :end => :environment do
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
namespace :resource_publish do
|
namespace :resource_publish do
|
||||||
desc "start publish resource"
|
desc "start publish resource"
|
||||||
task :publish => :environment do
|
task :publish => :environment do
|
||||||
|
puts "--------------------------------resource_publish start"
|
||||||
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
attachments = Attachment.where("publish_time = '#{Date.today}'")
|
||||||
attachments.each do |attachment|
|
attachments.each do |attachment|
|
||||||
attachment.update_column('is_publish', 1)
|
attachment.update_column('is_publish', 1)
|
||||||
end
|
end
|
||||||
|
puts "--------------------------------resource_publish end"
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue