Sha256: c37cd274e7040a6354949d6810e8e30aadd3593f3a8c4ad64a72b175bdc18f07

Contents?: true

Size: 953 Bytes

Versions: 2

Compression:

Stored size: 953 Bytes

Contents

#!/usr/bin/env ruby
require 'optimus-runner/server/optimus_runner_sm'
require 'rufus/scheduler'
require 'logger'
require 'optimus-runner/utils/optimuscloudenv'


optimus_runner_sm = OptimusRunnerSM.new
scheduler = Rufus::Scheduler.new
logger = Logger.new(STDOUT)
logger.level = Logger::WARN
logger.info "Starting Optimus runner..."
puts ARGV
OptimusCloudEnvLoader.new.loadEnv
scheduler.interval '5s', :first_in => 0.1 do
    logger.info "Is Optimus runner idle? #{optimus_runner_sm.idle?}"
    optimus_runner_sm.create if optimus_runner_sm.idle?
    optimus_runner_sm.add if optimus_runner_sm.new_device_added?
    optimus_runner_sm.remove if optimus_runner_sm.device_removed?
    optimus_runner_sm.restart if optimus_runner_sm.session_terminated?
    optimus_runner_sm.empty if optimus_runner_sm.cloud_session_empty? # You have done FLUSHALL in akira
end

scheduler.every '1m', :first_in => 60 do
    optimus_runner_sm.session_state 
end
scheduler.join

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
optimus-runner-1.2.0 exe/optimus_runner_manager
optimus-runner-1.1.4 exe/optimus_runner_manager