add modTime & refresh if file changed

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-09-29 21:31:10 +02:00
parent 3f2699f7e0
commit 6b0bf83c97
2 changed files with 42 additions and 28 deletions

View File

@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
)
func getParquetColumns(s Server, path string) []string {
@@ -82,6 +83,14 @@ func getFileSize(path string) uint64 {
return uint64(info.Size() / (1024 * 1024)) // MB
}
func getModTime(path string) time.Time {
info, err := os.Stat(path)
if err != nil {
return time.Time{}
}
return info.ModTime()
}
func FormatParquetName(path string) string {
_, file := filepath.Split(path)
fileName := strings.TrimSuffix(file, ".parquet")