Permalink
Browse files

move run_periodically to travis-support and poll asset version period…

…ically
  • Loading branch information...
1 parent 3d736ac commit 63e967d26cf108b88711885c22ef16fa11f73fbb Sven Fuchs committed May 2, 2012
Showing with 15 additions and 30 deletions.
  1. +0 −4 Gemfile
  2. +2 −9 Gemfile.lock
  3. +13 −17 lib/travis/hub.rb
View
@@ -1,12 +1,8 @@
source :rubygems
gem 'travis-core', :git => "git://github.com/travis-ci/travis-core", :require => 'travis/engine', :branch => 'asset-host'
-# gem 'travis-core', :path => "~/Development/projects/travis/travis-core", :branch => 'asset-host'
gem 'travis-support', :git => "git://github.com/travis-ci/travis-support"
-# TODO figure out a better way to distribute the assets version and remove this
-gem 'travis-assets', :git => 'https://github.com/travis-ci/travis-assets'
-
gem 'gh', :git => 'git://github.com/rkh/gh'
gem 'hubble', :git => 'git://github.com/mattmatt/hubble'
gem 'newrelic_rpm', '~> 3.3.2'
View
@@ -23,7 +23,7 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-core
- revision: 55d4a359566b1ca7a109aae86fb61dd48f5973ab
+ revision: e1c6b3eb9c1dda7bd5a3e172f7616d6ee546dd1f
branch: asset-host
specs:
travis-core (0.0.1)
@@ -46,16 +46,10 @@ GIT
GIT
remote: git://github.com/travis-ci/travis-support
- revision: d978ec91ffb454b4e2529a2f967a15e883e8a6b6
+ revision: 58ccfbd9706f0247fb54e617dbfedc28eef798f2
specs:
travis-support (0.0.1)
-GIT
- remote: https://github.com/travis-ci/travis-assets
- revision: 31ac0ba1304997927714ef7fc750add8aaa37faf
- specs:
- travis-assets (0.0.1)
-
GEM
remote: http://rubygems.org/
specs:
@@ -216,7 +210,6 @@ DEPENDENCIES
newrelic_rpm (~> 3.3.2)
rollout!
rspec (~> 2.7.0)
- travis-assets!
travis-core!
travis-support!
webmock (~> 1.8.0)
View
@@ -1,12 +1,14 @@
require 'multi_json'
require 'hashr'
require 'benchmark'
+require 'hubble'
require 'metriks'
require 'metriks/reporter/logger'
+
require 'core_ext/module/include'
-require 'hubble'
+require 'core_ext/kernel/run_periodically'
+
require 'travis'
-require 'travis/assets'
require 'travis/support'
require 'travis/hub/async'
require 'travis/hub/instrumentation'
@@ -28,22 +30,17 @@ def start
new.subscribe
end
- def prune_workers
- run_periodically(Travis.config.workers.prune.interval, &::Worker.method(:prune))
- end
-
- def cleanup_jobs
- run_periodically(Travis.config.jobs.retry.interval, &::Job.method(:cleanup))
- end
-
protected
def setup
+ Travis.config.update_periodically
+
# TODO ask @rkh about this :)
GH::DefaultStack.options[:ssl] = {
:ca_path => Travis.config.ssl.ca_file,
:ca_file => Travis.config.ssl.ca_file
}
+
start_monitoring
Database.connect
Travis::Mailer.setup
@@ -58,13 +55,12 @@ def start_monitoring
Monitoring.start if File.exists?('config/newrelic.yml')
end
- def run_periodically(interval, &block)
- Thread.new do
- loop do
- block.call
- sleep(interval)
- end
- end
+ def prune_workers
+ run_periodically(Travis.config.workers.prune.interval, &::Worker.method(:prune))
+ end
+
+ def cleanup_jobs
+ run_periodically(Travis.config.jobs.retry.interval, &::Job.method(:cleanup))
end
end

0 comments on commit 63e967d

Please sign in to comment.