-
Notifications
You must be signed in to change notification settings - Fork 115
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
Make sure the last modified timestamp is set correctly #1515
Conversation
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.
LGTM
e1f822c
to
c5019d3
Compare
c5019d3
to
dcc14e9
Compare
The test failure was that if the artifact was already wrapped once with error it might be still created (bnds principle is to never really 'fail' but only emit an error/warning), so the second time it finds the cache file and proceeds without an error. I now choose to simply delete the result file in case of an error, a more sophisticated approach might would store the error message along with the cached file but this has some uncertainties e.g if the error was not caused by the artifact itself so this seems the safe and easy path for now as one should not optimize for the error case. |
Linux stores modification time with nano-seconds precision, but we currently set the timestamp of the cached file only in milliseconds. This can lead to the situation that the source is considered a few nanoseconds older than the cache file and therefore the cache is regenerated every time.
dcc14e9
to
d0396e3
Compare
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.
Makes sense to me.
if (jar != null) { | ||
jar.close(); | ||
} | ||
wrap.getJar().ifPresent(jar -> jar.close()); |
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 could probably use a Method reference here.
Linux stores modification time with nano-seconds precision, but we currently set the timestamp of the cached file only in milliseconds. This can lead to the situation that the source is considered a few nanoseconds older than the cache file and therefore the cache is regenerated every time.