Reload routes config file on SIGHUP (#412)

This commit is contained in:
Justin Barlow
2025-05-11 07:02:19 -06:00
committed by GitHub
parent a46a423b0a
commit 0af57252dc
3 changed files with 31 additions and 9 deletions
+4 -2
View File
@@ -3,10 +3,11 @@ package server
import (
"context"
"encoding/json"
"time"
"github.com/fsnotify/fsnotify"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"time"
"io/fs"
"os"
@@ -15,6 +16,7 @@ import (
type IRoutesConfig interface {
ReadRoutesConfig(routesConfig string)
ReloadRoutesConfig()
AddMapping(serverAddress string, backend string)
DeleteMapping(serverAddress string)
SetDefaultRoute(backend string)
@@ -56,7 +58,7 @@ func (r *routesConfigImpl) ReadRoutesConfig(routesConfig string) error {
return nil
}
func (r *routesConfigImpl) reloadRoutesConfig() error {
func (r *routesConfigImpl) ReloadRoutesConfig() error {
config, readErr := r.readRoutesConfigFile()
if readErr != nil {