Skip to content

Commit

Permalink
Ensure the pre-load executor is reused across calls (digital-asset#8716)
Browse files Browse the repository at this point in the history
changelog_begin
changelog_end

The current behavior is that of creating a new preload executor at every call,
which is a very complex way of simply spawning a thread and defeats the purpose
of having a shared executor, sequencing the pre-loading of packages to maximize
the usage of cache (among other things).
  • Loading branch information
stefanobaghino-da authored Feb 2, 2021
1 parent f13c96b commit d6cbd86
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ final private[kvutils] class PackageCommitter(
}
}

private[this] def preloadExecutor =
private[this] lazy val preloadExecutor =
Executors.newSingleThreadExecutor { (runnable: Runnable) =>
val t = new Thread(runnable)
t.setDaemon(true)
Expand Down

0 comments on commit d6cbd86

Please sign in to comment.