-
Notifications
You must be signed in to change notification settings - Fork 0
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
remove the provenance file from the dataset #4
Conversation
removes the provenance files, moves the folder into the dataset and writes the file again if something went wrong.
try { | ||
transactionV2.moveFile(transactionV2.getIncoming().getAbsolutePath(), dataSet); | ||
} catch (Exception e) { | ||
Files.write(provenanceFile.toPath().toAbsolutePath(), buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm like 99% sure openBIS will automatically recover deleted files (I think it stores a copy of the original folder) on failure, so I advise against writing anything after an exception the ETL service - I'm not sure how this will influence the behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the catch case, see my comment. Other than that the code looks good
@wow-such-code so the recovery is not needed? |
Co-authored-by: wow-such-code <[email protected]>
Yes, it will recover by itself in an error case. The only case where files can vanish is if the script runs through without any errors and without moving files. |
removes the provenance files, moves the folder into the dataset and writes the file again if something went wrong.
See #3 for details on the reason for this change.