Permalink
Browse files

modifying auto start to start thread only when in development mode an…

…d reverted unnecessary changes in project model
  • Loading branch information...
1 parent 0d8b953 commit 43fb6ecf4d92d4c2d7bc5550485b9ce1b05c910d Nikhil Vallishayee committed Mar 29, 2011
Showing with 4 additions and 4 deletions.
  1. +3 −3 app/models/project.rb
  2. +1 −1 config/initializers/poller_auto_start.rb
View
@@ -64,7 +64,7 @@ def path(extra = '')
end
def latest_build
- builds.first || Build::NilBuild.new("")
+ builds.first || Build.null
end
def copy_latest_build_to_its_own_folder
@@ -78,7 +78,7 @@ def build(task = :default)
write_build_version
write_change_list
@logger.info "Building #{name}"
- Environment.system("source $HOME/.rvm/scripts/rvm && cd #{code_path} && BUNDLE_GEMFILE='' && #{command} #{task.to_s} 2>&1") do |output, result|
+ Environment.system("source $HOME/.rvm/scripts/rvm && cd #{code_path} && BUNDLE_GEMFILE='' #{command} #{task.to_s} 2>&1") do |output, result|
Environment.write_file(build_log_path, output)
@logger.info "Build status #{result}"
Environment.write_file(build_status_path, result)
@@ -113,7 +113,7 @@ def force_build
end
def write_change_list
- if latest_build.version.nil?
+ if latest_build.null?
return
end
latest_build_version = latest_build.version
@@ -1 +1 @@
-Thread.new { Goldberg::GoldbergInit.new.start_poller if ::Rails.env == "development" }
+Thread.new { Goldberg::GoldbergInit.new.start_poller } if ::Rails.env == "development"

0 comments on commit 43fb6ec

Please sign in to comment.