Skip to content

Commit

Permalink
cron now has a timeline client
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Dec 10, 2024
1 parent 35d772c commit 5c3195e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/ftl-cron/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/TBD54566975/ftl"
"github.com/TBD54566975/ftl/backend/cron"
"github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/ftlv1connect"
"github.com/TBD54566975/ftl/backend/timeline"
_ "github.com/TBD54566975/ftl/internal/automaxprocs" // Set GOMAXPROCS to match Linux container CPU quota.
"github.com/TBD54566975/ftl/internal/log"
"github.com/TBD54566975/ftl/internal/observability"
Expand All @@ -35,11 +36,11 @@ func main() {
err := observability.Init(ctx, false, "", "ftl-cron", ftl.Version, cli.ObservabilityConfig)
kctx.FatalIfErrorf(err, "failed to initialize observability")

// ctx = timeline.ContextWithClient(ctx, timeline.NewClient(ctx, cli.TimelineEndpoint))

schemaClient := rpc.Dial(ftlv1connect.NewSchemaServiceClient, cli.CronConfig.SchemaServiceEndpoint.String(), log.Error)
eventSource := schemaeventsource.New(ctx, schemaClient)

ctx = timeline.ContextWithClient(ctx, timeline.NewClient(ctx, cli.CronConfig.TimelineEndpoint))

routeManager := routing.NewVerbRouter(ctx, schemaeventsource.New(ctx, schemaClient))
err = cron.Start(ctx, eventSource, routeManager)
kctx.FatalIfErrorf(err, "failed to start cron")
Expand Down

0 comments on commit 5c3195e

Please sign in to comment.