Fix missing config handling and auto-restart after setup
This commit is contained in:
@@ -2,8 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
@@ -88,7 +90,7 @@ func main() {
|
||||
// Load config for server settings (optional)
|
||||
cfg, err := config.Load(*configPath)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if errors.Is(err, fs.ErrNotExist) {
|
||||
// Use defaults if config file doesn't exist
|
||||
slog.Info("config file not found, using defaults", "path", *configPath)
|
||||
cfg = &config.Config{}
|
||||
|
||||
Reference in New Issue
Block a user