Sha256: eaf6b2d72e09f9541bbbf7e18d8e99c8127ca4f98c62611870fbea1e7b797372

Contents?: true

Size: 489 Bytes

Versions: 107

Compression:

Stored size: 489 Bytes

Contents

require 'business_time'
require 'httparty'

namespace :wco do


  desc 'run office actions'
  task run_office_actions: :environment do
    puts! "Starting wco_email:run_office_actions..."
    while true do

      schs = Wco::OfficeAction.active.where({ :perform_at.lte => Time.now })
      print "[#{schs.length}]" if schs.length != 0
      schs.each do |sch|

        sch.do_run

        print "[#{sch.id}]^"
        sleep 15
      end

      print '.'
      sleep 15
    end
  end

end

Version data entries

107 entries across 107 versions & 1 rubygems

Version Path
wco_models-3.1.0.199 lib/tasks/office_tasks.rake
wco_models-3.1.0.198 lib/tasks/office_tasks.rake
wco_models-3.1.0.197 lib/tasks/office_tasks.rake
wco_models-3.1.0.196 lib/tasks/office_tasks.rake
wco_models-3.1.0.195 lib/tasks/office_tasks.rake
wco_models-3.1.0.194 lib/tasks/office_tasks.rake
wco_models-3.1.0.193 lib/tasks/office_tasks.rake
wco_models-3.1.0.192 lib/tasks/office_tasks.rake
wco_models-3.1.0.191 lib/tasks/office_tasks.rake
wco_models-3.1.0.190 lib/tasks/office_tasks.rake
wco_models-3.1.0.189 lib/tasks/office_tasks.rake
wco_models-3.1.0.188 lib/tasks/office_tasks.rake
wco_models-3.1.0.187 lib/tasks/office_tasks.rake
wco_models-3.1.0.184 lib/tasks/office_tasks.rake
wco_models-3.1.0.183 lib/tasks/office_tasks.rake
wco_models-3.1.0.182 lib/tasks/office_tasks.rake
wco_models-3.1.0.181 lib/tasks/office_tasks.rake
wco_models-3.1.0.180 lib/tasks/office_tasks.rake
wco_models-3.1.0.178 lib/tasks/office_tasks.rake
wco_models-3.1.0.177 lib/tasks/office_tasks.rake