This commit is contained in:
antanst
2025-10-14 16:58:38 +03:00
parent d336bdffba
commit 0e218cb57b
6 changed files with 216 additions and 24 deletions

View File

@@ -22,7 +22,7 @@ import (
func main() {
config.CONFIG = *config.GetConfig()
logging.SetupLogging()
logging.SetupLogging(config.CONFIG.LogLevel)
logger := logging.Logger
ctx := logging.WithLogger(context.Background(), logger)
err := runApp(ctx)
@@ -42,9 +42,11 @@ func runApp(ctx context.Context) error {
signals := make(chan os.Signal, 1)
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
// Only this file should send to this channel.
// All external functions should return errors.
fatalErrors := make(chan error)
// Root server context, used to cancel
// Root context, used to cancel
// connections and graceful shutdown.
serverCtx, cancel := context.WithCancel(ctx)
defer cancel()