Skip to content

Commit

Permalink
feat(worker): connect to temporal on start
Browse files Browse the repository at this point in the history
  • Loading branch information
Zibbp committed Mar 20, 2024
1 parent 753e92b commit 599e7dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 599e7dd

Please sign in to comment.