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 39 ['TERM', 'INT'].each do |signal|
40 40 Signal.trap(signal) do
41 41 stop
42   - RAILS_DEFAULT_LOGGER.info("Feed updater exiting gracefully ...")
  42 + puts "Feed updater exiting gracefully ..."
43 43 end
44 44 end
  45 + puts "Feed updater started."
45 46 run
46   - RAILS_DEFAULT_LOGGER.info("Feed updater exited.")
  47 + puts "Feed updater exited."
47 48 end
48 49  
49 50 def run
... ...
script/feed-updater
... ... @@ -12,20 +12,22 @@ require 'optparse'
12 12 NOOSFERO_ROOT = File.expand_path(File.dirname(__FILE__) + '/../')
13 13  
14 14 options = {
  15 + :app_name => 'feed-updater.default',
15 16 :dir_mode => :normal,
16 17 :dir => File.dirname(__FILE__) + '/../tmp/pids',
17 18 :multiple => false,
18 19 :backtrace => true,
  20 + :log_output => true,
19 21 :monitor => false
20 22 }
21 23  
22 24 OptionParser.new do |opts|
23 25 opts.on("-i", "--identifier=i", "Id") do |i|
24   - options[:identifier] = i
  26 + options[:app_name] = "feed-updater.#{i}"
25 27 end
26 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 31 require NOOSFERO_ROOT + '/config/environment'
30 32 FeedUpdater.new.start
31 33 end
... ...