From 688ac52705c2e4bd015e8f369969de6a91e26d80 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 22 May 2023 00:26:30 +0300 Subject: catch signals for shutdown --- internal/client/client.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'internal/client') diff --git a/internal/client/client.go b/internal/client/client.go index 299623d..eab3514 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -2,9 +2,26 @@ package client import ( "context" + "log" + "time" "codeberg.org/snonux/gorum/internal/config" ) func Start(ctx context.Context, conf config.Config) { + go func() { + for { + log.Println("Client server") + start(ctx, conf) + + select { + case <-time.After(time.Second): + case <-ctx.Done(): + return + } + } + }() +} + +func start(ctx context.Context, conf config.Config) { } -- cgit v1.2.3