Skip to content

Commit

Permalink
[BE-TASKS] Enhance ReactionWatchTask Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
occidere committed Sep 24, 2020
1 parent 4b25bc9 commit ef5e8c9
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ object ReactionWatchTask extends Task with GithubWatcherLogger {
// Diff & Send line message
val changedReactions = latestReactions.filter(latest => {
val diff = ReactionDiff(prevReactions.getOrElse(latest.uniqueKey, copyReactionWithoutCounts(latest)), latest)
println(s"repo: ${diff.latestReaction.repoOwnerLogin}/${diff.latestReaction.repoName}, changed: ${diff.hasChanged}")
Try(if (diff.hasChanged) LineMessengerService.sendReactionMessage(diff)) match {
case Failure(e) =>
logger.error(s"${latest.uniqueKey} process failed", e)
logger.error(s"${latest.uniqueKey} process failed (htmlUrl: ${latest.htmlUrl})", e)
false
case Success(_) =>
logger.info(s"${latest.uniqueKey} process success")
logger.info(s"${latest.uniqueKey} process success (htmlUrl: ${latest.htmlUrl})")
diff.hasChanged
}
})
Expand Down

0 comments on commit ef5e8c9

Please sign in to comment.