Sha256: 6e0e8004ab6a87252e6e7edb6c9515782a23cd09afc6bd175fd0e96469af7285
Contents?: true
Size: 749 Bytes
Versions: 3
Compression:
Stored size: 749 Bytes
Contents
#!/usr/bin/env ruby Dir.chdir(File.join(File.dirname(__FILE__), '..')) $:.unshift(File.dirname(__FILE__) + "/../lib") require 'rubygems' require 'bundler' begin Bundler.setup(:default) rescue Bundler::BundlerError => e $stderr.puts e.message $stderr.puts "Run `bundle install` to install missing gems" exit e.status_code end require 'fire_and_forget' include FAF::Daemon[:publish] File.open(File.join(File.dirname(__FILE__), "../../long.out"), 'w') do |file| file.sync = true file.write("PID: #{$$}\n") file.write(`ps -xO nice | grep '^#{$$}'`) file.write("\n") 60.times do |i| file.write("#{i}\n") begin set_status(i) rescue Exception => e file.write(e.to_s + "\n") end sleep(1) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
fire_and_forget-0.1.2 | examples/long_task |
fire_and_forget-0.1.1 | examples/long_task |
fire_and_forget-0.1.0 | examples/long_task |