From 599e7dd073daf852b6eb3c9f90677573c3a04418 Mon Sep 17 00:00:00 2001 From: Zibbp Date: Wed, 20 Mar 2024 23:24:18 +0000 Subject: [PATCH] feat(worker): connect to temporal on start --- cmd/worker/main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/worker/main.go b/cmd/worker/main.go index 7c8937cd..0b4bee6f 100644 --- a/cmd/worker/main.go +++ b/cmd/worker/main.go @@ -9,6 +9,7 @@ import ( "github.com/zibbp/ganymede/internal/activities" serverConfig "github.com/zibbp/ganymede/internal/config" "github.com/zibbp/ganymede/internal/database" + "github.com/zibbp/ganymede/internal/temporal" "github.com/zibbp/ganymede/internal/twitch" "github.com/zibbp/ganymede/internal/workflows" @@ -108,7 +109,7 @@ func main() { // this needs to be removed in the future to decouple the worker from the server serverConfig.NewConfig(false) - logger := zerolog.New(os.Stdout).With().Timestamp().Logger() + logger := zerolog.New(os.Stdout).With().Timestamp().Logger().With().Str("service", "worker").Logger() clientOptions := client.Options{ HostPort: config.TEMPORAL_URL, @@ -129,6 +130,9 @@ func main() { database.InitializeDatabase(true) + // Initialize the temporal client for the worker + temporal.InitializeTemporalClient() + taskQueues := map[string]int{ "archive": 100, "chat-download": config.MAX_CHAT_DOWNLOAD_EXECUTIONS,