Skip to content

Commit

Permalink
Merge pull request #29 from Tecsisa/28-add-new-helper-method
Browse files Browse the repository at this point in the history
Add new method to improve resilience (closes #28)
  • Loading branch information
gerson24 committed Sep 16, 2016
2 parents 66326bc + 583b52f commit b3f3258
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ final class ConsulCoordination(
}
}

override def addSelf[A: NodeSerialization](self: A, ttl: FiniteDuration) = {
override def addSelf[A: NodeSerialization](self: A, ttl: FiniteDuration) = createIfNotExist(self, ttl)

def createIfNotExist[A: NodeSerialization](self: A, ttl: FiniteDuration) = {
val keyUri = nodesUri.withPath(nodesUri.path / Base64.getUrlEncoder.encodeToString(implicitly[NodeSerialization[A]].toBytes(self)))
val addSelfWithPreviousSession = for {
Some(sessionId) <- retrieveSessionForKey(keyUri)
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import sbt._
object Version {
final val Scala = "2.11.8"
final val ConstructrAkka = "0.13.2"
final val raptureJsonCirce = "2.0.0-M5"
final val raptureJsonCirce = "2.0.0-M7"
final val Akka = "2.4.4"
final val AkkaLog4j = "1.1.3"
final val ScalaTest = "2.2.6"
Expand Down

0 comments on commit b3f3258

Please sign in to comment.