Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix file processor running on files that are on unfinished upload runs. #1506

Merged
merged 6 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading