You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,7 @@ the env var `GO111MODULE=on`, which enables you to develop outside of
37
37
|||**file watch**|
38
38
|`-polling=…` | false | Use polling instead of FS notifications to detect changes. Default is false
39
39
|`-polling-interval=…` | 100 | Milliseconds of interval between polling file changes when polling option is selected
40
+
|`-work-delay=…`| 900 | Milliseconds to wait (debounce) before starting a build after file changes settle; each new change resets the timer. Must be a positive integer.|
40
41
|||**misc**|
41
42
|`-color=_`| false | Colorize the output of the daemon's status messages. |
42
43
|`-log-prefix=_`| true | Prefix all child process output with stdout/stderr labels and log timestamps. |
Copy file name to clipboardExpand all lines: daemon.go
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ There are command line options.
49
49
FILE WATCH
50
50
-polling - Use polling instead of FS notifications to detect changes. Default is false
51
51
-polling-interval - Milliseconds of interval between polling file changes when polling option is selected
52
+
-work-delay - Milliseconds to wait (debounce) before starting a build after file changes settle (must be > 0)
52
53
53
54
MISC
54
55
-color - Enable colorized output
@@ -82,8 +83,9 @@ import (
82
83
"github.com/fatih/color"
83
84
)
84
85
85
-
// Milliseconds to wait for the next job to begin after a file change
86
-
constWorkDelay=900
86
+
// DefaultWorkDelay is the default -work-delay value: milliseconds to wait before
87
+
// starting a build after file changes (inrush / debounce).
88
+
constDefaultWorkDelay=900
87
89
88
90
// Default pattern to match files which trigger a build
89
91
constFilePattern=`(.+\.go|.+\.c)$`
@@ -135,6 +137,7 @@ var (
135
137
flagVerbose=flag.Bool("verbose", false, "Be verbose about which directories are watched.")
136
138
flagPolling=flag.Bool("polling", false, "Use polling method to watch file change instead of fsnotify")
137
139
flagPollingInterval=flag.Int("polling-interval", 100, "Milliseconds of interval between polling file changes when polling option is selected")
140
+
flagWorkDelay=flag.Int("work-delay", DefaultWorkDelay, "Milliseconds to wait (debounce) before starting a build after file changes settle; must be > 0")
0 commit comments