mirror of
https://github.com/ysoftdevs/odc-analyzer.git
synced 2026-03-26 19:11:48 +01:00
Propagate exceptions when caching in order to make errors less magic
This commit is contained in:
@@ -25,8 +25,9 @@ class ProjectReportsProvider @Inject() (
|
|||||||
(implicit executionContext: ExecutionContext): Future[T] =
|
(implicit executionContext: ExecutionContext): Future[T] =
|
||||||
{
|
{
|
||||||
cache.get[T](name).map(Future.successful).getOrElse(
|
cache.get[T](name).map(Future.successful).getOrElse(
|
||||||
f.andThen{
|
f.map{ value =>
|
||||||
case Success(value) =>cache.set(name, value, expiration)
|
cache.set(name, value, expiration)
|
||||||
|
value
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user