From d0e4ee404845ba175c9a66db7a48ac95b341f464 Mon Sep 17 00:00:00 2001 From: Matthew Hicks Date: Sun, 22 Jun 2008 18:29:12 -0400 Subject: Removing thread functionality - doesn't work with the service --- cloudmasterd/extra/cloudmasterd.spec | 2 +- cloudmasterd/lib/cloudmasterd.rb | 19 +++++++++++-------- cloudmasterd/lib/cloudmasterd/version.rb | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cloudmasterd/extra/cloudmasterd.spec b/cloudmasterd/extra/cloudmasterd.spec index 2977d02..3a52dca 100644 --- a/cloudmasterd/extra/cloudmasterd.spec +++ b/cloudmasterd/extra/cloudmasterd.spec @@ -6,7 +6,7 @@ Summary: daemon for machine configuration Name: rubygem-%{gemname} -Version: 0.1.6 +Version: 0.1.7 Release: 1%{?dist} Group: Development/Languages License: GPLv2+ or Ruby diff --git a/cloudmasterd/lib/cloudmasterd.rb b/cloudmasterd/lib/cloudmasterd.rb index 2a32879..86182eb 100644 --- a/cloudmasterd/lib/cloudmasterd.rb +++ b/cloudmasterd/lib/cloudmasterd.rb @@ -281,6 +281,9 @@ module Cloudmasterd::Controllers class Status < REST 'status' def list + # TODO: Figure out how to move this to a background thread + Cloudmasterd::Helpers::Syncer.run + @machines = {} Machine.find(:all, :select => "distinct email").map{|x| x.email}.each do |email| @machines[email] = Machine.find(:all, :conditions => "email = '#{email}'", :order => 'cloud') @@ -388,8 +391,8 @@ module Cloudmasterd::Views end def Cloudmasterd.create - ActiveRecord::Base.logger = Logger.new(STDOUT) - ActiveRecord::Base.colorize_logging = true + #ActiveRecord::Base.logger = Logger.new(STDOUT) + #ActiveRecord::Base.colorize_logging = true ActiveRecord::Base.pluralize_table_names = false ActiveRecord::Base.establish_connection( @@ -402,11 +405,11 @@ def Cloudmasterd.create Cloudmasterd::Helpers::Syncer.run end -Thread.new do - while true do - Cloudmasterd::Helpers::Syncer.run - sleep 5 - end -end +#Thread.new do +# while true do +# Cloudmasterd::Helpers::Syncer.run +# sleep 5 +# end +#end Cloudmasterd.start_picnic diff --git a/cloudmasterd/lib/cloudmasterd/version.rb b/cloudmasterd/lib/cloudmasterd/version.rb index 5bb4764..d45b0fd 100644 --- a/cloudmasterd/lib/cloudmasterd/version.rb +++ b/cloudmasterd/lib/cloudmasterd/version.rb @@ -2,7 +2,7 @@ module Cloudmasterd #:nodoc: module VERSION #:nodoc: MAJOR = 0 MINOR = 1 - TINY = 6 + TINY = 7 STRING = [MAJOR, MINOR, TINY].join('.') end -- cgit