plugins/client_pkg/client_pkg.rb in rsence-2.2.0 vs plugins/client_pkg/client_pkg.rb in rsence-2.2.1
- old
+ new
@@ -53,21 +53,19 @@
@log_file = nil
end
end
def rebuild_client
- while @build_busy
- puts "-- build busy, sleeping.. --"
- sleep 0.1
- end
@build_busy = true
- @last_change = Time.now.to_i
+ next_change=Time.now.to_f
@client_build.setup_dirs
- @client_build.run
- @client_cache = ClientPkgCache.new
- @client_cache.set_cache( @client_build.js, @client_build.gz, @client_build.themes )
+ @client_build.run( next_change )
+ client_cache = ClientPkgCache.new
+ client_cache.set_cache( @client_build.js, @client_build.gz, @client_build.themes )
+ @client_cache = client_cache
RSence.plugin_manager.incr! if RSence.config[:transporter_conf][:client_autoreload]
+ @last_change = next_change
@build_busy = false
end
def ready?
return (not @build_busy)
@@ -77,10 +75,10 @@
if not @thr and RSence.args[:autoupdate]
@thr = Thread.new do
Thread.pass
while true
begin
- if @client_build.bundle_changes( @last_change )
+ if not @build_busy and @client_build.bundle_changes( @last_change )
rebuild_client
puts "Autobuilt."
if RSence.args[:say]
Thread.new do
Thread.pass