Skip to content

Commit

Permalink
Merge pull request #1506 from phac-nml/fix_early_file_processor
Browse files Browse the repository at this point in the history
Fix file processor running on files that are on unfinished upload runs.
  • Loading branch information
deepsidhu85 committed Dec 14, 2023
2 parents 2c22e85 + 997fa5e commit 3486466
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# [23.10.1] - 2023/12/07
* [UI]: Fixed issue where filter inputs required focus when they are opened on the project samples page. See [PR 1503](https://github.com/phac-nml/irida/pull/1503)
* [UI]: Fixed bug preventing sorting and paging on the project members page. See [PR 1504](https://github.com/phac-nml/irida/pull/1504)
* [Developer]: Fixed race condition where FastQC file processor would start on incomplete file by filtering out files on non complete sequencing runs. [PR 1506](https://github.com/phac-nml/irida/pull/1506)

## [23.10] - 2023/10/15
* [Developer]: Added functionality to delete sequence files from file system when a sequence run is removed. [See PR 1468](https://github.com/phac-nml/irida/pull/1468)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca.corefacility.bioinformatics.irida.service;

import ca.corefacility.bioinformatics.irida.model.sequenceFile.SequencingObject;
import ca.corefacility.bioinformatics.irida.model.enums.SequencingRunUploadStatus;
import ca.corefacility.bioinformatics.irida.processing.FileProcessingChain;
import ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequencingObjectRepository;
import ca.corefacility.bioinformatics.irida.service.impl.processor.SequenceFileProcessorLauncher;
Expand Down Expand Up @@ -66,6 +67,12 @@ public synchronized void findFilesToProcess() {
List<SequencingObject> toProcess = sequencingObjectRepository
.getSequencingObjectsWithProcessingState(SequencingObject.ProcessingState.UNPROCESSED);

// filter out sequencing objects on a SequencingRun that is not in a COMPLETE state
toProcess.removeIf(seqObj -> (
(seqObj.getSequencingRun() != null) &&
(!seqObj.getSequencingRun().getUploadStatus().equals(SequencingRunUploadStatus.COMPLETE))
));

// individually loop through and mark the ones we're going to process. Looping individually so 2 processes are less likely to write at the same time.
Iterator<SequencingObject> iterator = toProcess.iterator();

Expand Down

0 comments on commit 3486466

Please sign in to comment.