Skip to content

Commit

Permalink
Scala Common Enrich: bump scala-weather to 0.3.0 (closes #3334)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenFradet committed Aug 24, 2017
1 parent b5eb479 commit 0345576
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 3-enrich/scala-common-enrich/project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ object Dependencies {
val json4s = "3.2.11"
val igluClient = "0.5.0"
val scalaForex = "0.5.0"
val scalaWeather = "0.2.0"
val scalaWeather = "0.3.0"
val scalaj = "2.3.0"
val gatlingJsonpath = "0.6.4"
// Scala (test only)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ case class WeatherEnrichment(apiKey: String, cacheSize: Int, geoPrecision: Int,
* @return optional weather stamp
*/
private def getCachedOrRequest(latitude: Float, longitude: Float, timestamp: Int): Validation[String, Weather] =
client.getCachedOrRequest(latitude, longitude, timestamp).validation.fold(_.toString.failure, _.success)
client.getCachedOrRequest(latitude, longitude, timestamp) match {
case Right(w) => w.success
case Left(e) => e.toString.failure
}

/**
* Add Iglu URI to JSON Object
Expand Down

0 comments on commit 0345576

Please sign in to comment.