File tree Expand file tree Collapse file tree 1 file changed +35
-21
lines changed
runner/daemon/src/mill/daemon Expand file tree Collapse file tree 1 file changed +35
-21
lines changed Original file line number Diff line number Diff line change @@ -393,29 +393,43 @@ object MillMain0 {
393393 watched = watchRes.watched
394394 )
395395
396+ def waitWithoutWatching () = {
397+ Some {
398+ try Success (Await .result(sessionResultFuture, Duration .Inf ))
399+ catch {
400+ case NonFatal (ex) =>
401+ Failure (ex)
402+ }
403+ }
404+ }
405+
396406 val res =
397- if (config.bspWatch)
398- Watching .watchAndWait(
399- watchRes.watched,
400- Watching .WatchArgs (
401- setIdle = setIdle,
402- colors = mill.internal.Colors .BlackWhite ,
403- useNotify = config.watchViaFsNotify,
404- daemonDir = daemonDir
405- ),
406- () => sessionResultFuture.value,
407- " " ,
408- watchLogger.info(_)
409- )
410- else {
411- watchLogger.info(" Watching of build sources disabled" )
412- Some {
413- try Success (Await .result(sessionResultFuture, Duration .Inf ))
414- catch {
415- case NonFatal (ex) =>
416- Failure (ex)
417- }
407+ if (config.bspWatch) {
408+ try {
409+ Watching .watchAndWait(
410+ watchRes.watched,
411+ Watching .WatchArgs (
412+ setIdle = setIdle,
413+ colors = mill.internal.Colors .BlackWhite ,
414+ useNotify = config.watchViaFsNotify,
415+ daemonDir = daemonDir
416+ ),
417+ () => sessionResultFuture.value,
418+ " " ,
419+ watchLogger.info(_)
420+ )
421+ } catch {
422+ case e : Exception =>
423+ val sw = new java.io.StringWriter
424+ e.printStackTrace(new java.io.PrintWriter (sw))
425+ watchLogger.info(
426+ " Watching of build sources failed:" + e + " \n " + sw
427+ )
428+ waitWithoutWatching()
418429 }
430+ } else {
431+ watchLogger.info(" Watching of build sources disabled" )
432+ waitWithoutWatching()
419433 }
420434
421435 // Suspend any BSP request until the next call to startSession
You can’t perform that action at this time.
0 commit comments