Skip to content

Commit

Permalink
Named lock for published files
Browse files Browse the repository at this point in the history
  • Loading branch information
apetkau committed Jan 21, 2024
1 parent 5fc5466 commit 623d54e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import nextflow.iridanext.MetadataParserJSON
@CompileStatic
class IridaNextObserver implements TraceObserver {
private static final tasksLock = new Object[0]
private static final publishedFilesLock = new Object[0]

private Map<Path,Path> publishedFiles = [:]
private List<TaskRun> tasks = []
Expand Down Expand Up @@ -221,7 +222,7 @@ class IridaNextObserver implements TraceObserver {
}

@Override
@Synchronized
@Synchronized("publishedFilesLock")
void onFilePublish(Path destination, Path source) {
if (publishedFiles.containsKey(source)) {
throw new Exception("Error: file with source=${source} was already published")
Expand Down

0 comments on commit 623d54e

Please sign in to comment.