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
Using userspace last-modified property #917
Conversation
try { | ||
getNode().setProperty(FEDORA_LASTMODIFIED, Calendar.getInstance(getTimeZone("UTC"))); | ||
} catch (final RepositoryException e) { | ||
LOGGER.info("Exception caught when trying to update lastModified date", e); |
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.
Maybe LOGGER::error
here?
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.
Also, please do not dump the full exception (i.e. LOGGER.info("...", e)
). Instead, just log the e.getMessage()
.
I've made the logging changes suggested and updated the lastModified test to round the dates to the nearest second to avoid intermittent failures. |
@escowles, is there a reason why |
@@ -347,7 +353,9 @@ public Date getCreatedDate() { | |||
public Date getLastModifiedDate() { | |||
|
|||
try { | |||
if (hasProperty(JCR_LASTMODIFIED)) { | |||
if (hasProperty(FEDORA_LASTMODIFIED)) { | |||
return new Date(getProperty(FEDORA_LASTMODIFIED).getDate().getTimeInMillis()); |
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.
Some logging could be nice to help debug where the date is coming from.
I've updated |
I am seeing some immediate, unexpected behavior:
@escowles, do you feel confident in this implementation? I am inclined to wait on further testing until you feel like all of the scenarios work as you would expect. |
I'm not surprised there are some additional places where we need to call touch(). The general whack-a-mole nature of this PR makes me think a little time writing up the expected behavior would be time well spent. |
… earlier than created date
Closing this in favor of #1033 |
Fixes https://jira.duraspace.org/browse/FCREPO-1742