Skip to content

Commit 7aa8a62

Browse files
committed
bump version to 0.3.0
1 parent 707713b commit 7aa8a62

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name := "scala-retry"
22

33
organization := "com.github.hipjim"
44

5-
crossScalaVersions := Seq("2.10.6", "2.11.10", "2.12.7")
5+
crossScalaVersions := Seq("2.10.6", "2.11.10", "2.12.8")
66

7-
version := "0.2.4"
7+
version := "0.3.0"
88

9-
scalaVersion := "2.12.7"
9+
scalaVersion := "2.12.8"
1010

1111
// Force building with Java 8
1212
initialize := {

src/main/scala/util/retry/blocking/Retry.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package util.retry.blocking
22

33
import util.retry.blocking.RetryStrategy.RetryStrategyProducer
44

5-
import scala.concurrent.{ExecutionContext, Future}
65
import scala.util.Try
76
import scala.util.control.NonFatal
87

@@ -107,18 +106,20 @@ final case class Failure[+T](exception: Throwable) extends Retry[T] {
107106
override def transform[X](f: T => X): X = throw exception
108107
override def flatMap[S](f: T => Retry[S]): Retry[S] = Failure(exception)
109108
override def map[S](f: T => S)(
110-
implicit strategy: () => RetryStrategy): Retry[S] = Failure(exception)
109+
implicit strategy: RetryStrategyProducer): Retry[S] = Failure(exception)
111110
}
112111

113112
object Retry {
114-
def apply[T](fn: => T)(implicit strategy: () => RetryStrategy): Retry[T] = {
113+
def apply[T](fn: => T)(implicit strategy: RetryStrategyProducer): Retry[T] = {
115114
def go(fn: => T)(strategy: RetryStrategy): Retry[T] = {
116115
Try(fn) match {
117116
case x: scala.util.Success[T] =>
118117
Success(x.value)
119118
case _ if strategy.shouldRetry() =>
119+
println("retrying")
120120
go(fn)(strategy.update())
121121
case f: scala.util.Failure[T] =>
122+
println("giving up")
122123
Failure(f.exception)
123124
}
124125
}

0 commit comments

Comments
 (0)