add more hints for s3
This commit is contained in:
parent
cc0a286471
commit
5c1a887b07
18
src/fsS3.ts
18
src/fsS3.ts
@ -309,7 +309,14 @@ const fromS3ObjectToEntity = (
|
|||||||
) => {
|
) => {
|
||||||
// console.debug(`fromS3ObjectToEntity: ${x.Key!}, ${JSON.stringify(x,null,2)}`);
|
// console.debug(`fromS3ObjectToEntity: ${x.Key!}, ${JSON.stringify(x,null,2)}`);
|
||||||
// S3 officially only supports seconds precision!!!!!
|
// S3 officially only supports seconds precision!!!!!
|
||||||
const mtimeSvr = Math.floor(x.LastModified!.valueOf() / 1000.0) * 1000;
|
if (x.LastModified === undefined) {
|
||||||
|
throw Error(
|
||||||
|
`s3 object ${x.Key!} doesn't have LastModified value: ${JSON.stringify(
|
||||||
|
x
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const mtimeSvr = Math.floor(x.LastModified.valueOf() / 1000.0) * 1000;
|
||||||
let mtimeCli = mtimeSvr;
|
let mtimeCli = mtimeSvr;
|
||||||
if (x.Key! in mtimeRecords) {
|
if (x.Key! in mtimeRecords) {
|
||||||
const m2 = mtimeRecords[x.Key!];
|
const m2 = mtimeRecords[x.Key!];
|
||||||
@ -346,7 +353,14 @@ const fromS3HeadObjectToEntity = (
|
|||||||
) => {
|
) => {
|
||||||
// console.debug(`fromS3HeadObjectToEntity: ${fileOrFolderPathWithRemotePrefix}: ${JSON.stringify(x,null,2)}`);
|
// console.debug(`fromS3HeadObjectToEntity: ${fileOrFolderPathWithRemotePrefix}: ${JSON.stringify(x,null,2)}`);
|
||||||
// S3 officially only supports seconds precision!!!!!
|
// S3 officially only supports seconds precision!!!!!
|
||||||
const mtimeSvr = Math.floor(x.LastModified!.valueOf() / 1000.0) * 1000;
|
if (x.LastModified === undefined) {
|
||||||
|
throw Error(
|
||||||
|
`s3 object ${fileOrFolderPathWithRemotePrefix} doesn't have LastModified value: ${JSON.stringify(
|
||||||
|
x
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const mtimeSvr = Math.floor(x.LastModified.valueOf() / 1000.0) * 1000;
|
||||||
let mtimeCli = mtimeSvr;
|
let mtimeCli = mtimeSvr;
|
||||||
if (useAccurateMTime && x.Metadata !== undefined) {
|
if (useAccurateMTime && x.Metadata !== undefined) {
|
||||||
const m2 = Math.floor(
|
const m2 = Math.floor(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user