Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove prompt update hash check #3933

Merged
merged 3 commits into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions main/util/src/mill/util/PromptLogger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,6 @@ private[mill] object PromptLogger {
currentTimeMillis: () => Long,
infoColor: fansi.Attrs
) {
private var lastRenderedPromptHash = 0

private val statuses = collection.mutable.SortedMap
.empty[Seq[String], Status](PromptLoggerUtil.seqStringOrdering)

Expand All @@ -340,7 +338,7 @@ private[mill] object PromptLogger {

def getCurrentPrompt() = currentPromptBytes

private def updatePromptBytes(ending: Boolean = false) = {
def updatePrompt(ending: Boolean = false): Unit = {
val now = currentTimeMillis()
for (k <- statuses.keySet) {
val removedTime = statuses(k).beginTransitionTime
Expand Down Expand Up @@ -405,17 +403,6 @@ private[mill] object PromptLogger {
)
}
}

def updatePrompt(ending: Boolean = false): Unit = {
// For non-interactive jobs, we only want to print the new prompt if the contents
// differs from the previous prompt, since the prompts do not overwrite each other
// in log files and printing large numbers of identical prompts is spammy and useless
lazy val statusesHashCode = statuses.hashCode
if (consoleDims()._1.nonEmpty || statusesHashCode != lastRenderedPromptHash) {
lastRenderedPromptHash = statusesHashCode
updatePromptBytes(ending)
}
}
}

}
Loading