Sha256: 212b1c20f9d3200c1c7ca3742730e8bd0bcd5cd92a46b45046a5325c90108538

Contents?: true

Size: 516 Bytes

Versions: 3

Compression:

Stored size: 516 Bytes

Contents

#!/usr/bin/env ruby

# You might want to change this
ENV["RAILS_ENV"] ||= "production"

root = File.expand_path(File.dirname(__FILE__))
root = File.dirname(root) until File.exists?(File.join(root, 'config'))
Dir.chdir(root)

require File.join(root, "config", "environment")

$running = true
Signal.trap("TERM") do 
  $running = false
end

while($running) do
  
  # Replace this with your code
  Rails.logger.auto_flushing = true
  Rails.logger.info "This daemon is still running at #{Time.now}.\n"
  
  sleep 10
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
daemons-rails-1.2.1 lib/generators/templates/script.rb
daemons-rails-1.2.0 lib/generators/templates/script.rb
daemons-rails-1.1.2 lib/generators/templates/script.rb