This is better.

This commit is contained in:
Aria Moradi
2021-04-04 03:37:00 +04:30
parent 7a52e19235
commit 177c971b52
6 changed files with 28 additions and 23 deletions
@@ -75,9 +75,11 @@ class TestExtensions {
semaphore.withPermit {
logger.info { "$index - Now fetching popular manga from $source" }
try {
mangaToFetch += source to (source.fetchPopularManga(1)
.awaitSingleRepeat().mangas.firstOrNull()
?: throw Exception("Source returned no manga"))
mangaToFetch += source to (
source.fetchPopularManga(1)
.awaitSingleRepeat().mangas.firstOrNull()
?: throw Exception("Source returned no manga")
)
} catch (e: Exception) {
logger.warn { "Failed to fetch popular manga from $source: ${e.message}" }
failedToFetch += source to e
@@ -185,4 +187,4 @@ class TestExtensions {
}
return awaitSingle()
}
}
}
@@ -9,4 +9,4 @@ fun setLoggingEnabled(enabled: Boolean = true) {
logger.level = if (enabled) {
Level.DEBUG
} else Level.ERROR
}
}