diff options
| author | Paul Buetow <paul@buetow.org> | 2023-05-22 00:26:30 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2023-05-22 00:26:30 +0300 |
| commit | 688ac52705c2e4bd015e8f369969de6a91e26d80 (patch) | |
| tree | de2f160b3ffaf750c60585f59257045d7dda3c14 /internal/client | |
| parent | bb79f9f50a89507fb7db6d1d4c62630e431952f9 (diff) | |
catch signals for shutdown
Diffstat (limited to 'internal/client')
| -rw-r--r-- | internal/client/client.go | 17 |
1 files changed, 17 insertions, 0 deletions
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) { } |
