added cache folder check
This commit is contained in:
parent
44e9d3356f
commit
ff84d49ff3
2 changed files with 16 additions and 12 deletions
8
init.go
8
init.go
|
@ -70,6 +70,14 @@ func main() {
|
|||
printInfo("Node client is disabled.")
|
||||
}
|
||||
|
||||
// Check if the cache directory exists when caching is enabled
|
||||
if config.DriveCacheEnabled {
|
||||
if _, err := os.Stat(config.DriveCache.Path); os.IsNotExist(err) {
|
||||
printErr("Error: Drive cache is enabled, but cache directory '%s' does not exist.\n", config.DriveCache.Path)
|
||||
os.Exit(1) // Exit with a non-zero status to indicate an error
|
||||
}
|
||||
}
|
||||
|
||||
// Start periodic cleanup of expired cache files
|
||||
if config.DriveCacheEnabled {
|
||||
go cleanExpiredCachedImages()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue