From 0155c36af1d08aa4b56ed1f86213ce1c91a1cc87 Mon Sep 17 00:00:00 2001 From: Samuel Lorch Date: Thu, 9 May 2024 04:41:57 +0200 Subject: [PATCH] Worker Use UUID from Config --- worker/worker.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worker/worker.go b/worker/worker.go index 670ef2a..54ef359 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -26,8 +26,15 @@ var rpcServer = rpc.NewServer() func Start(_conf config.Config) { conf = _conf ctx, cancel := context.WithCancel(context.Background()) + defer cancel() - uuid := uuid.New() + // TODO Generate and Save a ID if the Config has none + //uuid := uuid.New() + uuid, err := uuid.Parse(conf.Worker.ID) + if err != nil { + slog.Error("Cannot Parse ID", "err", err) + return + } sigs := make(chan os.Signal, 1) signal.Notify(sigs, os.Interrupt)