Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Commit

Permalink
make clock interval configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed May 11, 2011
1 parent 705e553 commit db345b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ to get a command list.

== Credits

Astro (2005-2008)
Neingeist
Tigion
Josef Spillner
J-_-L
Others (MySQL patch)
* {Astro}[https://github.com/astro] (2005-2008)
* Neingeist
* Tigion
* Josef Spillner
* {J-_-L}[https://github.com/janlelis]
* Others (MySQL patch)
14 changes: 11 additions & 3 deletions bin/harvester-clock
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ STDERR.sync = STDOUT.sync = true
harve = Harvester.new_from_argv
harve.logger.info 'CLOCK'

# get interval
if ARGV.first
interval = ARGV.shift.to_i
else
interval = harve.settings['interval'] || 2.minutes
end

harve.logger.info "[start] invoke harvester-run every #{ interval } seconds"

handler do |job|
# harve.logger.info '[start] invoke harvester'
spawn File.dirname(__FILE__) + '/harvester'
spawn File.dirname(__FILE__) + '/harvester-run'
end

# TODO configure in settings
every 1.minute, 'run'
every interval, 'run'

run
3 changes: 2 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ settings:
templates: data/templates
output: html
size limit: 202400
timeout: 90
interval: 100
timeout: 20
log_file: STDOUT
log_level: debug
db:
Expand Down

0 comments on commit db345b5

Please sign in to comment.