aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-12-08 20:52:04 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2023-12-08 20:52:04 -0500
commitb564708f29cf8a709c3e3d981477b2ec8440673e (patch)
treeb5eb4b728111fb7746b08a0b6231deab63a2960f
parentfdf78dd5bf25f345cc8419cc547cdbafaf54ae86 (diff)
patch and close issue #2 for empty/non existent index files
-rw-r--r--back-end/src/Storage/MinioClientManager.cs4
-rw-r--r--back-end/src/StorageExtensions.cs9
-rw-r--r--ci/config/Essentials.Accounts.json4
3 files changed, 9 insertions, 8 deletions
diff --git a/back-end/src/Storage/MinioClientManager.cs b/back-end/src/Storage/MinioClientManager.cs
index a817ba6..c7867b2 100644
--- a/back-end/src/Storage/MinioClientManager.cs
+++ b/back-end/src/Storage/MinioClientManager.cs
@@ -123,13 +123,13 @@ namespace Content.Publishing.Blog.Admin.Storage
{
//Get the post content file
ObjectStat stat = await Client.GetObjectAsync(args, cancellation);
+ return stat.Size;
}
catch (Minio.Exceptions.ObjectNotFoundException)
{
//File not found
- return -1;
+ return -1L;
}
- return output.Position;
}
}
}
diff --git a/back-end/src/StorageExtensions.cs b/back-end/src/StorageExtensions.cs
index 8acb26e..3227585 100644
--- a/back-end/src/StorageExtensions.cs
+++ b/back-end/src/StorageExtensions.cs
@@ -170,10 +170,11 @@ namespace Content.Publishing.Blog.Admin
//Mem stream to read the object into
using VnMemoryStream ms = new();
- await storage.ReadFileAsync(objPath, ms, cancellation);
-
- //Load the db from the stream
- db.Load(ms);
+ if(await storage.ReadFileAsync(objPath, ms, cancellation) > 0)
+ {
+ //Load the db from the stream
+ db.Load(ms);
+ }
}
}
diff --git a/ci/config/Essentials.Accounts.json b/ci/config/Essentials.Accounts.json
index 8903cc1..47ab0fb 100644
--- a/ci/config/Essentials.Accounts.json
+++ b/ci/config/Essentials.Accounts.json
@@ -11,8 +11,8 @@
"keepalive_endpoint": {
"path": "/api/account/keepalive",
- //Regen token every 15 mins along with cookies
- "token_refresh_sec": 600 //15 minutes
+ //Regen token every 10 mins along with cookies
+ "token_refresh_sec": 600 //10 minutes
},
"profile_endpoint": {