-
Notifications
You must be signed in to change notification settings - Fork 51
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
datapublisher.php batch export fix #1223
Conversation
When running datapublisher in batch mode, creation of MeasurementsOrFact extension file failed for all export files except the first file archive generated.
I think this resolves BioKIC/symbiota-docs#299 |
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.
Good catch on closing the file handler within DwcArchiverBaseManager file. Not closing it would cause the records left in the buffer to fail to write. Also possible file lock errors when moving or deleting.
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.
You probably should keep the $this->attributeHandler->__destruct(); and $this->materialSampleHandler->__destruct(); and just set them to null afterward. Calling destruct method closes connections and log file handlers triggered within the extended manage class. Such as:
if($this->attributeHandler !== null){
$this->attributeHandler->__destruct();
$this->attributeHandler = null;
}
The __destruct function is automatically called when the last reference to an object is removed. I tested locally and confirmed that DwcArchiverAttribute __destruct() is called when $this->attributeHandler = null; is executed. |
Yes, that sounds right. The __destruct function is automatically called when the object is destroyed, and thus does not need to be explicitly called. |
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.
Looks great as is
When running datapublisher in batch mode, creation of MeasurementsOrFact extension file failed for all export files except the first file archive generated.
Pull Request Checklist:
Pre-Approval
master
branch and squash and merged back into themaster
branch.Development
branch, NOTmaster
Post-Approval
Development
branch, remember to use the squash & merge optionDevelopment
branch into the master branch, remember to use the merge optionmaster
branch, a subsequent PR frommaster
intoDevelopment
should be made merge option (i.e., no squash).Development
branch before a tagged release (i.e., before an imminent merge into the master branch), make sure to notify the team and lock theDevelopment
branch to prevent accidental merges while QA takes place. Follow the release protocol here.Thanks for contributing and keeping it clean!