3

我正在使用 Clockwork gem 来运行一系列 rake 任务。一切看起来都不错,但似乎puts命令没有出现在日志中,只是想知道是否有人知道为什么?

require File.expand_path('../../config/boot',        __FILE__)
require File.expand_path('../../config/environment', __FILE__)
require 'clockwork'

include Clockwork

module Clockwork
    configure do |config|
        config[:max_threads] = 30
        config[:thread] = true
    end

    error_handler do |error|
        Airbrake.notify_or_ignore(error)
    end

    handler do |job|
        Rails.logger.info "Enqueuing job: '#{job}'"
    end

    every(60.seconds, 'Test Job') {
        `rake testing_clockwork`
        }

end



desc 'Testing Clockwork'
task :testing_clockwork => :environment do

    puts "Testing Clockwork"

    Rails.logger.info("Testing Clockwork")


end
4

0 回答 0