日常查询由mysql改为clickhouse

This commit is contained in:
robin
2026-02-08 02:00:51 +08:00
parent bc223fd1aa
commit b7388d83b0
43 changed files with 657 additions and 353 deletions

View File

@@ -0,0 +1,18 @@
//go:build !windows
package dbutils
import (
"golang.org/x/sys/unix"
)
func checkHasFreeSpace(dir string) bool {
var stat unix.Statfs_t
err := unix.Statfs(dir, &stat)
if err != nil {
return true
}
var availableSpace = (stat.Bavail * uint64(stat.Bsize)) / (1 << 30) // GB
return availableSpace > minFreeSpaceGB
}