Merge branch 'master' of github.com:plashchynski/crono

This commit is contained in:
Dzmitry Plashchynski
2015-04-11 18:24:07 +03:00
6 changed files with 80 additions and 4 deletions

View File

@@ -50,6 +50,7 @@ module Crono
end
def write_pid
return unless config.pidfile
pidfile = File.expand_path(config.pidfile)
File.write(pidfile, ::Process.pid)
end

View File

@@ -10,9 +10,12 @@ module Crono
def initialize
self.cronotab = CRONOTAB
self.logfile = LOGFILE
self.pidfile = PIDFILE
self.daemonize = false
self.environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development'
end
def pidfile
@pidfile || (daemonize ? PIDFILE : nil)
end
end
end