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

Dev word 404 #6

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
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
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,3 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Test
run: export MYSQL_PASSWORD=root && mvn test
- name: Test coverage
run: |
bash <(curl https://codecov.io/bash)
1 change: 1 addition & 0 deletions .github/workflows/docker-build-and-push-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 'main'
- 'dev-**'

jobs:
docker:
Expand Down
10 changes: 7 additions & 3 deletions src/main/kotlin/nhk/service/NewsParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NewsParser {
}
news.m3u8Url = parseAudioUrl(topNews)
news.publishedAtUtc = ZonedDateTime.of(topNews.newsPrearrangedTime, ZoneId.of("+9")).toInstant()
news.words = parseWords(newsId)
// news.words = parseWords(newsId)

return news
}
Expand All @@ -67,7 +67,9 @@ class NewsParser {
val response = okHttpClient.newCall(request).execute()

if (response.code != 200) {
throw RuntimeException("Failed to get words for news ${newsId}, statusCode=${response.code}")
logger.warn("Failed to get words for news ${newsId}, statusCode=${response.code}")

return mutableSetOf()
}

val json = response.body?.string()
Expand All @@ -85,7 +87,9 @@ class NewsParser {
}.toMutableSet()
}

throw RuntimeException("words are empty")
logger.warn("words are empty, news id is $newsId")

return mutableSetOf()
}

private fun parseWord(entry: Map.Entry<String, JsonNode>): List<Word> {
Expand Down
Loading