From f9936ad7056c5621c4abef5a261f0ac8f6698f15 Mon Sep 17 00:00:00 2001 From: Aditya Ujeniya Date: Fri, 27 Sep 2024 17:15:06 +0200 Subject: [PATCH] Fix to findFiles --- config.json | 10 +++++----- internal/memorystore/checkpoint.go | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.json b/config.json index c0d1197..23d8a10 100644 --- a/config.json +++ b/config.json @@ -166,20 +166,20 @@ } }, "checkpoints": { - "interval": "12h", + "interval": "1h", "directory": "./var/checkpoints", - "restore": "48h" + "restore": "1h" }, "archive": { - "interval": "168h", + "interval": "2h", "directory": "./var/archive" }, "http-api": { - "address": "localhost:8081", + "address": "localhost:8082", "https-cert-file": null, "https-key-file": null }, - "retention-in-memory": "48h", + "retention-in-memory": "1h", "nats": null, "jwt-public-key": "kzfYrYy+TzpanWZHJ5qSdMj5uKUWgq74BWhQG6copP0=" } \ No newline at end of file diff --git a/internal/memorystore/checkpoint.go b/internal/memorystore/checkpoint.go index 9b036d5..93585b6 100644 --- a/internal/memorystore/checkpoint.go +++ b/internal/memorystore/checkpoint.go @@ -478,8 +478,10 @@ func findFiles(direntries []fs.DirEntry, t int64, findMoreRecentFiles bool) ([]s e := direntries[i] ts1 := nums[e.Name()] - if findMoreRecentFiles && t <= ts1 || i == len(direntries)-1 { + if findMoreRecentFiles && t <= ts1 { filenames = append(filenames, e.Name()) + } + if i == len(direntries)-1 { continue }