MINOR: a small refactor for LogManage#shutdown (#9680)

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
This commit is contained in:
APaMio 2020-12-04 21:48:01 +08:00 committed by GitHub
parent 4cc6d204ec
commit df0c52e7fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -479,14 +479,14 @@ class LogManager(logDirs: Seq[File],
try {
for ((dir, dirJobs) <- jobs) {
val hasErrors = dirJobs.map { future =>
val hasErrors = dirJobs.exists { future =>
Try(future.get) match {
case Success(_) => false
case Failure(e) =>
warn(s"There was an error in one of the threads during LogManager shutdown: ${e.getCause}")
true
}
}.contains(true)
}
if (!hasErrors) {
val logs = logsInDir(localLogsByDir, dir)