Commit ef2f3ba370aa95eca1b61f305f8a1c794a13c908

Authored by Joenio Costa
Committed by Daniela Feitosa
1 parent 60733efa

Feed updater now has its own log file

- log files are in tmp/pids/*.output
- using 'default' as default value for '-i' option

(ActionItem1898)
Showing 2 changed files with 7 additions and 4 deletions   Show diff stats
lib/feed_updater.rb
@@ -39,11 +39,12 @@ class FeedUpdater @@ -39,11 +39,12 @@ class FeedUpdater
39 ['TERM', 'INT'].each do |signal| 39 ['TERM', 'INT'].each do |signal|
40 Signal.trap(signal) do 40 Signal.trap(signal) do
41 stop 41 stop
42 - RAILS_DEFAULT_LOGGER.info("Feed updater exiting gracefully ...") 42 + puts "Feed updater exiting gracefully ..."
43 end 43 end
44 end 44 end
  45 + puts "Feed updater started."
45 run 46 run
46 - RAILS_DEFAULT_LOGGER.info("Feed updater exited.") 47 + puts "Feed updater exited."
47 end 48 end
48 49
49 def run 50 def run
script/feed-updater
@@ -12,20 +12,22 @@ require 'optparse' @@ -12,20 +12,22 @@ require 'optparse'
12 NOOSFERO_ROOT = File.expand_path(File.dirname(__FILE__) + '/../') 12 NOOSFERO_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
13 13
14 options = { 14 options = {
  15 + :app_name => 'feed-updater.default',
15 :dir_mode => :normal, 16 :dir_mode => :normal,
16 :dir => File.dirname(__FILE__) + '/../tmp/pids', 17 :dir => File.dirname(__FILE__) + '/../tmp/pids',
17 :multiple => false, 18 :multiple => false,
18 :backtrace => true, 19 :backtrace => true,
  20 + :log_output => true,
19 :monitor => false 21 :monitor => false
20 } 22 }
21 23
22 OptionParser.new do |opts| 24 OptionParser.new do |opts|
23 opts.on("-i", "--identifier=i", "Id") do |i| 25 opts.on("-i", "--identifier=i", "Id") do |i|
24 - options[:identifier] = i 26 + options[:app_name] = "feed-updater.#{i}"
25 end 27 end
26 end.parse!(ARGV) 28 end.parse!(ARGV)
27 29
28 -Daemons.run_proc("feed-updater.#{options[:identifier]}", options) do 30 +Daemons.run_proc(options[:app_name], options) do
29 require NOOSFERO_ROOT + '/config/environment' 31 require NOOSFERO_ROOT + '/config/environment'
30 FeedUpdater.new.start 32 FeedUpdater.new.start
31 end 33 end