From 70049b196db1419f2c503d106700ee4ca9c4c868 Mon Sep 17 00:00:00 2001 From: erezrokah Date: Tue, 9 Jul 2024 13:11:44 +0100 Subject: [PATCH] feat: Pass invocation ID to scheduler --- plugins/source/hackernews/resources/plugin/client.go | 2 ++ plugins/source/k8s/resources/plugin/plugin.go | 2 +- plugins/source/test/resources/plugin/client.go | 1 + plugins/source/xkcd/resources/plugin/client.go | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/source/hackernews/resources/plugin/client.go b/plugins/source/hackernews/resources/plugin/client.go index 3ab2800c32eb84..eccac7ba7e2375 100644 --- a/plugins/source/hackernews/resources/plugin/client.go +++ b/plugins/source/hackernews/resources/plugin/client.go @@ -4,6 +4,7 @@ import ( "context" "encoding/json" "fmt" + "github.com/cloudquery/cloudquery/plugins/source/hackernews/client" "github.com/cloudquery/cloudquery/plugins/source/hackernews/resources/services/items" "github.com/cloudquery/plugin-sdk/v4/message" @@ -101,6 +102,7 @@ func Configure(_ context.Context, logger zerolog.Logger, specBytes []byte, opts logger: logger, scheduler: scheduler.NewScheduler( scheduler.WithLogger(logger), + scheduler.WithInvocationID(opts.InvocationID), ), tables: getTables(), }, nil diff --git a/plugins/source/k8s/resources/plugin/plugin.go b/plugins/source/k8s/resources/plugin/plugin.go index 50b0b0f5734b3e..1974b8d8c6314e 100644 --- a/plugins/source/k8s/resources/plugin/plugin.go +++ b/plugins/source/k8s/resources/plugin/plugin.go @@ -91,7 +91,7 @@ func newClient(ctx context.Context, logger zerolog.Logger, specBytes []byte, opt return nil, err } c.syncClient = syncClient.(*client.Client) - c.scheduler = scheduler.NewScheduler(scheduler.WithLogger(logger), scheduler.WithConcurrency(s.Concurrency)) + c.scheduler = scheduler.NewScheduler(scheduler.WithLogger(logger), scheduler.WithConcurrency(s.Concurrency), scheduler.WithInvocationID(options.InvocationID)) return c, nil } diff --git a/plugins/source/test/resources/plugin/client.go b/plugins/source/test/resources/plugin/client.go index 03cf05932cd263..63ec28975bba0f 100644 --- a/plugins/source/test/resources/plugin/client.go +++ b/plugins/source/test/resources/plugin/client.go @@ -119,6 +119,7 @@ func Configure(_ context.Context, logger zerolog.Logger, spec []byte, opts plugi config: *config, scheduler: scheduler.NewScheduler( scheduler.WithLogger(logger), + scheduler.WithInvocationID(opts.InvocationID), ), tables: getTables(*config), }, nil diff --git a/plugins/source/xkcd/resources/plugin/client.go b/plugins/source/xkcd/resources/plugin/client.go index 7966594d419d8a..bd38e1c7692513 100644 --- a/plugins/source/xkcd/resources/plugin/client.go +++ b/plugins/source/xkcd/resources/plugin/client.go @@ -126,6 +126,7 @@ func Configure(_ context.Context, logger zerolog.Logger, specBytes []byte, opts scheduler: scheduler.NewScheduler( scheduler.WithLogger(logger), scheduler.WithConcurrency(config.Concurrency), + scheduler.WithInvocationID(opts.InvocationID), ), services: xkcdClient, tables: getTables(),