Skip to content

Commit e196247

Browse files
Fix code review issues - remove unused imports, fix shutdown race condition
Co-authored-by: realcodywburns <13103499+realcodywburns@users.noreply.github.com>
1 parent 18a78f6 commit e196247

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/main/scala/com/chipprbots/ethereum/console/ConsoleUI.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,13 +433,13 @@ class ConsoleUI extends Logger {
433433
case 'd' =>
434434
shutdown()
435435
log.info("Console UI disabled, switching to standard logging")
436-
true
436+
false
437437
case _ =>
438438
true
439439
}
440440

441441
/** Shutdown and cleanup the console UI. */
442-
def shutdown(): Unit = {
442+
def shutdown(): Unit = synchronized {
443443
terminal.foreach { term =>
444444
try {
445445
// Show cursor

src/main/scala/com/chipprbots/ethereum/console/ConsoleUIUpdater.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
package com.chipprbots.ethereum.console
22

3-
import scala.concurrent.duration._
4-
5-
import cats.effect.IO
6-
import cats.effect.unsafe.implicits.global
7-
83
import org.apache.pekko.actor.typed.ActorRef
94
import org.apache.pekko.actor.typed.ActorSystem
105

@@ -94,7 +89,7 @@ class ConsoleUIUpdater(
9489
}
9590
}
9691
} finally {
97-
consoleUI.shutdown()
92+
// Shutdown is handled in StdNode.shutdown() to avoid race conditions
9893
}
9994
}
10095

0 commit comments

Comments
 (0)