Skip to content

DicomFileRunner should process files in parallel #440

Description

@rkm

Should be a straightforward change, but probably requires the report classes to handle concurrent writes if they don't already.

public override int Run()
{
_logger.Info($"Recursing from Directory: {_opts.Directory}");
if (!FileSystem.Directory.Exists(_opts.Directory))
{
_logger.Info($"Cannot Find directory: {_opts.Directory}");
throw new ArgumentException($"Cannot Find directory: {_opts.Directory}");
}
ProcessDirectory(_opts.Directory);
CloseReports();
return errors;
}
private void ProcessDirectory(string root)
{
//deal with files first
foreach (var file in FileSystem.Directory.GetFiles(root, _opts.Pattern))
{
try
{
ValidateDicomFile(FileSystem.FileInfo.New(file));
}
catch (Exception ex)
{
if (ThrowOnError)
{
throw;
}
else
{
_logger.Error(ex, $"Failed to validate {file}");
errors++;
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions