aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmd_windows.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd_windows.go b/cmd_windows.go
index 59df307..f76d95d 100644
--- a/cmd_windows.go
+++ b/cmd_windows.go
@@ -22,7 +22,8 @@ var (
sourceDir = flag.String("dir", "", "Source directory to watch (required)")
connect = flag.String("connect", "localhost:5151", "TCP address of the container to connect to")
bufSizeKB = flag.Int("bufsize", 256, "ReadDirectoryChangesW buffer size in KB per directory (default 256)")
- dumpFile = flag.String("dump", "", "Dump whitelist/blacklist to file and exit")
+ dumpFile = flag.String("dump", "", "Dump whitelist/blacklist to file and exit")
+ syncTimeout = flag.Int("sync-timeout", 10, "Minutes to wait for server sync to complete")
)
func run() {
@@ -413,7 +414,7 @@ func sendEvent(conn net.Conn, evt FileEvent) error {
func waitForSyncDone(conn net.Conn) error {
scanner := bufio.NewScanner(conn)
scanner.Buffer(make([]byte, 0, 1024*1024), 1024*1024)
- conn.SetReadDeadline(time.Now().Add(10 * time.Minute)) // large repos can take a while
+ conn.SetReadDeadline(time.Now().Add(time.Duration(*syncTimeout) * time.Minute))
defer conn.SetReadDeadline(time.Time{})
for scanner.Scan() {
msg, err := DecodeMessage(scanner.Bytes())