Merge pull request #992 from Mark-Simulacrum/master
Add listener latency option.
This commit is contained in:
commit
abfe5e673f
2 changed files with 8 additions and 1 deletions
|
@ -45,6 +45,11 @@ module Middleman::Cli
|
|||
:type => :boolean,
|
||||
:default => false,
|
||||
:desc => 'Force file watcher into polling mode'
|
||||
method_option :latency,
|
||||
:type => :numeric,
|
||||
:aliases => "-l",
|
||||
:default => 0.25,
|
||||
:desc => 'Set file watcher latency, in seconds'
|
||||
|
||||
# Start the server
|
||||
def server
|
||||
|
@ -66,7 +71,8 @@ module Middleman::Cli
|
|||
:instrumenting => options["instrument"],
|
||||
:disable_watcher => options["disable_watcher"],
|
||||
:reload_paths => options["reload_paths"],
|
||||
:force_polling => options["force_polling"]
|
||||
:force_polling => options["force_polling"],
|
||||
:latency => options["latency"]
|
||||
}
|
||||
|
||||
puts "== The Middleman is loading"
|
||||
|
|
|
@ -104,6 +104,7 @@ module Middleman
|
|||
# Watcher Library
|
||||
require "listen"
|
||||
@listener = Listen.to(Dir.pwd, :relative_paths => true, :force_polling => @options[:force_polling])
|
||||
@listener.latency(@options[:latency])
|
||||
end
|
||||
|
||||
@listener.change do |modified, added, removed|
|
||||
|
|
Loading…
Reference in a new issue