mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Implement persistence tests
This commit is contained in:
@@ -17,7 +17,8 @@ import (
|
||||
// @basePath /api/v1
|
||||
func main() {
|
||||
|
||||
config, err := llamactl.LoadConfig("")
|
||||
configPath := os.Getenv("LLAMACTL_CONFIG_PATH")
|
||||
config, err := llamactl.LoadConfig(configPath)
|
||||
if err != nil {
|
||||
fmt.Printf("Error loading config: %v\n", err)
|
||||
fmt.Println("Using default configuration.")
|
||||
@@ -25,13 +26,13 @@ func main() {
|
||||
|
||||
// Create the data directory if it doesn't exist
|
||||
if config.Instances.AutoCreateDirs {
|
||||
if err := os.MkdirAll(config.Instances.ConfigDir, 0755); err != nil {
|
||||
fmt.Printf("Error creating config directory %s: %v\n", config.Instances.ConfigDir, err)
|
||||
if err := os.MkdirAll(config.Instances.InstancesDir, 0755); err != nil {
|
||||
fmt.Printf("Error creating config directory %s: %v\n", config.Instances.InstancesDir, err)
|
||||
fmt.Println("Persistence will not be available.")
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(config.Instances.LogDir, 0755); err != nil {
|
||||
fmt.Printf("Error creating log directory %s: %v\n", config.Instances.LogDir, err)
|
||||
if err := os.MkdirAll(config.Instances.LogsDir, 0755); err != nil {
|
||||
fmt.Printf("Error creating log directory %s: %v\n", config.Instances.LogsDir, err)
|
||||
fmt.Println("Instance logs will not be available.")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user