Sha256: 0fdaf48a5ca6d8630e5abe73066202ee2d0a49d03e0a23dcd0d846664be119dd

Contents?: true

Size: 629 Bytes

Versions: 16

Compression:

Stored size: 629 Bytes

Contents

task :schedule do
  require 'rufus-scheduler'
  scheduler = Rufus::Scheduler.start_new

  logger = Logger.new(STDOUT)
  logger.level = Logger::DEBUG
  logger.formatter = proc do |severity, time, progname, msg|
    Smartkiosk::Common::Logging.format "Scheduler", severity, time, progname, msg
  end

  scheduler.every '1m' do
    logger.debug "Terminal ping"
    Terminal.ping
  end

  scheduler.every '3h' do
    logger.debug "Receipt Templates sync"
    Sync::ReceiptTemplatesWorker.perform_async
  end

  logger.debug "Schedule loaded"
  begin 
    scheduler.join
  rescue Interrupt
    logger.debug "Interrupting..."
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
smartkiosk-client-0.0.21 lib/tasks/scheduler.rb
smartkiosk-client-0.0.20 lib/tasks/scheduler.rb
smartkiosk-client-0.0.19 lib/tasks/scheduler.rb
smartkiosk-client-0.0.18 lib/tasks/scheduler.rb
smartkiosk-client-0.0.17 lib/tasks/scheduler.rb
smartkiosk-client-0.0.16 lib/tasks/scheduler.rb
smartkiosk-client-0.0.10 lib/tasks/scheduler.rb
smartkiosk-client-0.0.9 lib/tasks/scheduler.rb
smartkiosk-client-0.0.8 lib/tasks/scheduler.rb
smartkiosk-client-0.0.7 lib/tasks/scheduler.rb
smartkiosk-client-0.0.6 lib/tasks/scheduler.rb
smartkiosk-client-0.0.5 lib/tasks/scheduler.rb
smartkiosk-client-0.0.4 lib/tasks/scheduler.rb
smartkiosk-client-0.0.3 lib/tasks/scheduler.rb
smartkiosk-client-0.0.2 lib/tasks/scheduler.rb
smartkiosk-client-0.0.1 lib/tasks/scheduler.rb