Sha256: 3af194b6d1bb33ba56c9fa9a1879d5566477e8b25533507a93ebaea084d0dbb3

Contents?: true

Size: 462 Bytes

Versions: 29

Compression:

Stored size: 462 Bytes

Contents

def puts! a, b=''
  puts "+++ +++ #{b}"
  puts a.inspect
end

namespace :office do

  desc "send emails"
  task :email_worker => :environment do
    while true do

      ctxs = ::Ish::EmailContext.current.unsent
      puts! ctxs.count, 'ctxs'
      ctxs.map do |ctx|
        IshManager::OfficeMailer.send_context_email( ctx[:id].to_s ).deliver_later
        print '.'
      end

      # sleep 1.minute
      sleep 10.seconds
      print '^'

    end
  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ish_manager-0.1.8.376 lib/tasks/office_tasks.rake
ish_manager-0.1.8.374 lib/tasks/office_tasks.rake
ish_manager-0.1.8.373 lib/tasks/office_tasks.rake
ish_manager-0.1.8.372 lib/tasks/office_tasks.rake
ish_manager-0.1.8.371 lib/tasks/office_tasks.rake
ish_manager-0.1.8.370 lib/tasks/office_tasks.rake
ish_manager-0.1.8.369 lib/tasks/office_tasks.rake
ish_manager-0.1.8.368 lib/tasks/office_tasks.rake
ish_manager-0.1.8.367 lib/tasks/office_tasks.rake
ish_manager-0.1.8.366 lib/tasks/office_tasks.rake
ish_manager-0.1.8.365 lib/tasks/office_tasks.rake
ish_manager-0.1.8.364 lib/tasks/office_tasks.rake
ish_manager-0.1.8.363 lib/tasks/office_tasks.rake
ish_manager-0.1.8.362 lib/tasks/office_tasks.rake
ish_manager-0.1.8.361 lib/tasks/office_tasks.rake
ish_manager-0.1.8.360 lib/tasks/office_tasks.rake
ish_manager-0.1.8.359 lib/tasks/office_tasks.rake
ish_manager-0.1.8.358 lib/tasks/office_tasks.rake
ish_manager-0.1.8.357 lib/tasks/office_tasks.rake
ish_manager-0.1.8.356 lib/tasks/office_tasks.rake