diff options
| author | Luke Kanies <luke@madstop.com> | 2008-09-27 21:30:49 +0200 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2008-09-27 21:30:49 +0200 |
| commit | b96bdc6a63f7be6b724c2aa7ad0ea007cba81718 (patch) | |
| tree | 6d334ea12e1468b34160fa36da29dd7d78ac31ea /lib/puppet/network | |
| parent | e20f02af4a93478c5b08b7681caa12cd72b4a3a6 (diff) | |
| parent | 3749267093923692d6e7bc0c9ce83b43a487b19e (diff) | |
Merge branch '0.24.x' of git://github.com/jamtur01/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/client/master.rb | 16 | ||||
| -rw-r--r-- | lib/puppet/network/handler/master.rb | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 6f8e2770f..5e9422b7e 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -199,6 +199,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client self.class.instance = self @running = false + @splayed = false end # Mark that we should restart. The Puppet module checks whether we're running, @@ -478,20 +479,19 @@ class Puppet::Network::Client::Master < Puppet::Network::Client @lockfile end + def splayed? + @splayed + end + # Sleep when splay is enabled; else just return. def splay return unless Puppet[:splay] + return if splayed? - limit = Integer(Puppet[:splaylimit]) - - # Pick a splay time and then cache it. - unless time = Puppet::Util::Storage.cache(:configuration)[:splay_time] - time = rand(limit) - Puppet::Util::Storage.cache(:configuration)[:splay_time] = time - end - + time = rand(Integer(Puppet[:splaylimit])) Puppet.info "Sleeping for %s seconds (splay is enabled)" % time sleep(time) + @splayed = true end private diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 9682c460e..05ae7b9a2 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -24,7 +24,7 @@ class Puppet::Network::Handler # Tell a client whether there's a fresh config for it def freshness(client = nil, clientip = nil) # Always force a recompile. Newer clients shouldn't do this (as of April 2008). - Time.now + return 0 end def initialize(hash = {}) |
