dami0806 commented on code in PR #6650:
URL: https://github.com/apache/opendal/pull/6650#discussion_r2424022715
##########
bindings/c/src/metadata.rs:
##########
@@ -131,7 +131,9 @@ impl opendal_metadata {
let mtime = self.deref().last_modified();
match mtime {
None => -1,
- Some(time) => time.as_millisecond(),
+ Some(time) => {
+ time.as_second() * 1000 + (time.subsec_nanosecond() /
1_000_000) as i64
+ }
Review Comment:
When I created the Timestamp wrapper, I added methods like as_second() and
from_millisecond(), but I forgot to add as_millisecond().
I had implemented as_second() and from_millisecond() in the Timestamp
wrapper, but as_millisecond() was missing.
While implementing the C bindings, this caused a compilation error because
the method didn’t exist.
To quickly unblock myself and continue testing other parts, I used a
temporary workaround with manual calculation (as_second() * 1000 +
subsec_nanosecond() / 1_000_000).
After the tests passed, I should have gone back, properly added
as_millisecond() to the Timestamp wrapper, and cleaned up the temporary code,
but I missed it.
I should have been more careful and ensured that temporary workarounds were
properly cleaned up before committing. I apologize for leaving this temporary
code in the final commit.
I will now fix this properly by adding as_millisecond() to the Timestamp
wrapper in core/src/raw/time.rs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]