Skip to content

Commit

Permalink
Fix race condition on wave requests
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Feb 18, 2023
1 parent 1555e18 commit f57fae2
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,24 @@

package nextflow.container.resolver

import nextflow.plugin.Plugins

import nextflow.plugin.Plugins
/**
* Load an instance of {@link ContainerResolver}
*
* @author Paolo Di Tommaso <paolo.ditommaso@gmail.com>
*/
class ContainerResolverProvider {

static ContainerResolver load() {
/**
* Load the {@link ContainerResolver} instance via the plugin system.
*
* Use `synchronized` method to make it thread safe and prevent multiple instances
* of the same resolver type
*
* @return The {@link ContainerResolver} instance
*/
static synchronized ContainerResolver load() {
final resolvers = Plugins.getPriorityExtensions(ContainerResolver)
if( !resolvers )
throw new IllegalStateException("Cannot load ${ContainerResolver.class.simpleName}")
Expand Down

0 comments on commit f57fae2

Please sign in to comment.