@@ -84,9 +84,6 @@ import (
8484// Milliseconds to wait for the next job to begin after a file change
8585const WorkDelay = 900
8686
87- // Milliseconds of interval between polling file changes when polling option is selected
88- const PollingInterval = 100
89-
9087// Default pattern to match files which trigger a build
9188const FilePattern = `(.+\.go|.+\.c)$`
9289
@@ -124,6 +121,7 @@ var (
124121 flagGracefulTimeout = flag .Uint ("graceful-timeout" , 3 , "Duration (in seconds) to wait for graceful kill to complete" )
125122 flagVerbose = flag .Bool ("verbose" , false , "Be verbose about which directories are watched." )
126123 flagPolling = flag .Bool ("polling" , false , "Use polling method to watch file change instead of fsnotify" )
124+ flagPollingInterval = flag .Int ("polling-interval" , 100 , "Milliseconds of interval between polling file changes when polling option is selected" )
127125
128126 // initialized in main() due to custom type.
129127 flagDirectories globList
@@ -394,14 +392,15 @@ func main() {
394392 pattern := regexp .MustCompile (* flagPattern )
395393
396394 cfg := & WatcherConfig {
397- flagVerbose : * flagVerbose ,
398- flagRecursive : * flagRecursive ,
399- flagPolling : * flagPolling ,
400- flagDirectories : flagDirectories ,
401- flagExcludedDirs : flagExcludedDirs ,
402- flagExcludedFiles : flagExcludedFiles ,
403- flagIncludedFiles : flagIncludedFiles ,
404- pattern : pattern ,
395+ flagVerbose : * flagVerbose ,
396+ flagRecursive : * flagRecursive ,
397+ flagPolling : * flagPolling ,
398+ flagPollingInterval : * flagPollingInterval ,
399+ flagDirectories : flagDirectories ,
400+ flagExcludedDirs : flagExcludedDirs ,
401+ flagExcludedFiles : flagExcludedFiles ,
402+ flagIncludedFiles : flagIncludedFiles ,
403+ pattern : pattern ,
405404 }
406405 watcher , err := NewWatcher (cfg )
407406
0 commit comments