File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ private static async Task MainTask()
148148 //Console.WriteLine(Environment.Is64BitProcess ? "x64 version" : "x86 version");
149149 Console . WriteLine ( "Press Ctrl+C to stop the monitors." ) ;
150150
151- // start the monitor.
151+ //start the monitor.
152152 using ( var watch = new Watcher ( ) )
153153 {
154154 //var drvs = System.IO.DriveInfo.GetDrives();
@@ -169,13 +169,19 @@ private static async Task MainTask()
169169 var consoleWatch = new ConsoleWatch ( watch ) ;
170170
171171
172- var messageContext = new Context (
173- eventObj : null ,
174- token : new CancellationToken ( )
175- ) ;
172+ //start watching
173+ //NB! start watching before synchronisation
174+ watch . Start ( ) ;
175+
176176
177177 if ( true )
178178 {
179+ var messageContext = new Context (
180+ eventObj : null ,
181+ token : new CancellationToken ( )
182+ ) ;
183+
184+
179185 await ConsoleWatch . AddMessage ( ConsoleColor . White , "Doing initial synchronisation..." , messageContext ) ;
180186 ConsoleWatch . DoingInitialSync = true ; //NB!
181187
@@ -210,15 +216,12 @@ await ConsoleWatch.OnAddedAsync
210216 }
211217
212218
213- // start watching
214- watch . Start ( ) ;
215-
216- // listen for the Ctrl+C
219+ //listen for the Ctrl+C
217220 WaitForCtrlC ( ) ;
218221
219222 Console . WriteLine ( "Stopping..." ) ;
220223
221- // stop everything.
224+ //stop everything.
222225 watch . Stop ( ) ;
223226
224227 Console . WriteLine ( "Exiting..." ) ;
You can’t perform that action at this time.
0 commit comments