Skip to content

Commit

Permalink
remove recovery
Browse files Browse the repository at this point in the history
Co-authored-by: wow-such-code <[email protected]>
  • Loading branch information
KochTobi and wow-such-code committed Jun 3, 2024
1 parent 62ed696 commit 9b3a246
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,14 @@ public void process(IDataSetRegistrationTransactionV2 transaction) {
newDataSet.setPropertyValue(QPropertyType.Q_TASK_ID.getOpenBisPropertyName(), dataSetProvenance.taskId());
QDatasetType qDatasetType = getDatasetType(measurementSample);
newDataSet.setDataSetType(qDatasetType.name());
moveFiles(transaction, newDataSet, provenanceFile);

}

private void moveFiles(IDataSetRegistrationTransactionV2 transactionV2, IDataSet dataSet, File provenanceFile) {

try {
var buffer = Files.readAllBytes(provenanceFile.toPath().toAbsolutePath());
Files.delete(provenanceFile.toPath());
try {
transactionV2.moveFile(transactionV2.getIncoming().getAbsolutePath(), dataSet);
} catch (Exception e) {
Files.write(provenanceFile.toPath().toAbsolutePath(), buffer);
throw new RuntimeException(e);
}
transaction.moveFile(transaction.getIncoming().getAbsolutePath(), newDataSet);
} catch (IOException e) {
throw new RuntimeException(e);
}

}

private static QDatasetType getDatasetType(ISampleImmutable measurementSample) {
Expand Down

0 comments on commit 9b3a246

Please sign in to comment.