diff options
author | Diego <diegolparra@gmail.com> | 2015-05-21 15:17:20 -0300 |
---|---|---|
committer | Diego <diegolparra@gmail.com> | 2015-05-21 15:17:20 -0300 |
commit | f47cc5d6ff8e08599156c731db8a8335f6df3ada (patch) | |
tree | cf490e1bc5a4d8c23d533d53f28983ab5a4a1395 /kamon-core/src/main | |
parent | ac0b0bcfe9d31daa0d407932de27ca1fe77296c5 (diff) | |
download | Kamon-f47cc5d6ff8e08599156c731db8a8335f6df3ada.tar.gz Kamon-f47cc5d6ff8e08599156c731db8a8335f6df3ada.tar.bz2 Kamon-f47cc5d6ff8e08599156c731db8a8335f6df3ada.zip |
! core: avoid to evaluate code twice in TraceContext.withNewAsyncSegment and close #204
Diffstat (limited to 'kamon-core/src/main')
-rw-r--r-- | kamon-core/src/main/scala/kamon/trace/TraceContext.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala index 85b7396f..1bd72089 100644 --- a/kamon-core/src/main/scala/kamon/trace/TraceContext.scala +++ b/kamon-core/src/main/scala/kamon/trace/TraceContext.scala @@ -60,7 +60,7 @@ trait TraceContext { def withNewAsyncSegment[T](segmentName: String, category: String, library: String)(code: ⇒ Future[T]): Future[T] = { val segment = startSegment(segmentName, category, library) val result = code - code.onComplete(_ ⇒ segment.finish())(SameThreadExecutionContext) + result.onComplete(_ ⇒ segment.finish())(SameThreadExecutionContext) result } |