Sha256: caae319ef8402ff96b03205458c069e50cada904c713149cdce9114f9928c9c3

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

#!/usr/bin/env ruby

check = `ps ax | grep ruby`.split("\n").select{ |line| line.index($0) }
check.select! { |line| !line.index("#{Process.pid} ") }

if check.length > 0
  puts "Lux job_que allready running"
  puts check
  exit
end

eval File.read './lux/loader.rb'
Lux.delay.run!

# require 'pathname'
# pid_file = Pathname.new("./tmp/job_que.pid")

# if pid_file.exist?
#   pid = pid_file.read
#   proc = `ps -p #{pid} -o comm=`
#   if proc.to_s.length > 1
#     puts "Lux job_que allready running, pid: #{pid}"
#     system "ps ax | grep #{pid} | grep ruby"
#     exit
#   end
# end

# pid_file.write(Process.pid)
# Kernel.at_exit { pid_file.delete }


# Lux.config.redis_server = Redis::Queue.new('__test', 'bp__test', :redis => Redis.new)
# Lux.delay.server = :memory
# Lux.delay.server = :redis
# Lux.delay.push("puts '123 abc > mem'.red")
# Lux.delay.push("puts '123 abc > redis'.red")
# Lux.delay.push(Mailer.confirm_email('rejotl@gmail.com'), :deliver)
# Mailer.confirm_email('rejotl@gmail.com').deliver_later
# Lux.delay.run!

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lux-fw-0.1.35 ./bin/job_que
lux-fw-0.1.17 ./bin/job_que