Compare commits
3 Commits
12f6075bc9
...
af6d0d9138
Author | SHA1 | Date | |
---|---|---|---|
af6d0d9138 | |||
86d13f2f28 | |||
353ff28919 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "astro-uploader",
|
"name": "astro-uploader",
|
||||||
"version": "1.1.1",
|
"version": "1.1.3",
|
||||||
"description": "A uploader for uploading the Astro generated files through the S3 API.",
|
"description": "A uploader for uploading the Astro generated files through the S3 API.",
|
||||||
"keywords": ["Astro", "S3", "withastro", "opendal"],
|
"keywords": ["Astro", "S3", "withastro", "opendal"],
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -97,12 +97,12 @@ class Uploader {
|
|||||||
|
|
||||||
async isExist(key: string, size: number): Promise<boolean> {
|
async isExist(key: string, size: number): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
const { contentLength, isFile } = await this.operator.stat(key);
|
const { contentLength } = await this.operator.stat(key);
|
||||||
if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) {
|
if ((contentLength !== null && contentLength !== BigInt(size)) || this.override) {
|
||||||
await this.operator.delete(key);
|
await this.operator.delete(key);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return isFile();
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// Just ignore the error for now. If we find better solution for how to handle the opendal error.
|
// Just ignore the error for now. If we find better solution for how to handle the opendal error.
|
||||||
if (err instanceof Error) {
|
if (err instanceof Error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user