mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
fix(s3): truncate LastModified timestamps to second precision (#24)
This commit is contained in:
1 parent
38f7c5c2eb
commit
ad31e7a7b7
3 files changed
+11
-2
No files matched your search
@@ -3,6 +3,7 @@ package io.github.hectorvent.floci.services.s3.model;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
@RegisterForReflection
|
||||
public class Part {
|
||||
@@ -18,7 +19,7 @@ public class Part {
|
||||
this.partNumber = partNumber;
|
||||
this.eTag = eTag;
|
||||
this.size = size;
|
||||
this.lastModified = Instant.now();
|
||||
this.lastModified = Instant.now().truncatedTo(ChronoUnit.SECONDS);
|
||||
}
|
||||
|
||||
public int getPartNumber() { return partNumber; }
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -42,7 +43,7 @@ public class S3Object {
|
||||
this.data = data;
|
||||
this.contentType = contentType != null ? contentType : "application/octet-stream";
|
||||
this.size = data.length;
|
||||
this.lastModified = Instant.now();
|
||||
this.lastModified = Instant.now().truncatedTo(ChronoUnit.SECONDS);
|
||||
this.eTag = computeETag(data);
|
||||
this.metadata = new HashMap<>();
|
||||
this.tags = new HashMap<>();
|
||||
|
||||
Reference in new issue
Block a user