Skip to content

Commit

Permalink
feat : handle thread safe issue for getCurrentFutures(#1843) (#1844)
Browse files Browse the repository at this point in the history
cherry pick #1843
  • Loading branch information
younseunghyun authored Sep 14, 2023
1 parent 13c91fb commit 194328a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ class KotlinDataLoaderRegistry(
* @return list of current completable futures.
*/
fun getCurrentFutures(): List<CompletableFuture<*>> =
synchronized(registry.dataLoaders) {
registry.dataLoaders.map { dataLoader ->
dataLoader.cacheMap.all
}.flatten()
}
registry.dataLoaders.map { dataLoader ->
synchronized(dataLoader) {
dataLoader.cacheMap.all.toList()
}
}.flatten()

/**
* This will invoke [DataLoader.dispatch] on each of the registered [DataLoader]s,
Expand Down

0 comments on commit 194328a

Please sign in to comment.