lib/runit-man/service_info/base.rb in runit-man-2.4.1a1 vs lib/runit-man/service_info/base.rb in runit-man-2.4.1

- old
+ new

@@ -16,11 +16,11 @@ def to_hash data = {} [ :name, :stat, :active?, :logged?, :switchable?, - :log_file_location, :log_pid, :restart_dangerous? + :log_file_location, :log_pid, :watched_modified_files ].each do |sym| data[sym] = send(sym) end [ @@ -107,13 +107,15 @@ # All log file locations def all_log_file_locations [] end - def restart_dangerous? - ! ! files_to_watch.detect do |file| - mtime = File.stat(file).mtime - mtime > @status.started_at + def watched_modified_files + files_to_watch.map do |filepath| + mtime = File.stat(filepath).mtime.utc + { :path => filepath, :mtime => mtime } + end.select do |rec| + rec[:mtime] > @status.started_at end end def send_signal(signal) return unless supervise?