Fix missing config handling and auto-restart after setup

This commit is contained in:
Mikhail Chusavitin
2026-02-04 10:19:35 +03:00
parent fabd30650d
commit 7c606af2bb
3 changed files with 17 additions and 5 deletions

View File

@@ -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{}