Skip to content

Commit 79e8025

Browse files
authored
fix/bind-workflow-registry-once (#21856)
* fix/bind-workflow-registry-once * develop merge fix
1 parent a7be929 commit 79e8025

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

core/services/cre/cre.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ func newWorkflowRegistrySyncerV2(
844844
gatewayConnectorWrapper *gatewayconnector.ServiceWrapper,
845845
) (syncerV2.WorkflowRegistrySyncer, []commonsrv.Service, error) {
846846
capCfg := cfg.Capabilities()
847+
wfReg := capCfg.WorkflowRegistry()
847848
key := opts.WorkflowKey
848849

849850
fetcherFunc, retrieverFunc, srvcs, err := newFetcherServiceV2(opts, capCfg, lggr, gatewayConnectorWrapper)
@@ -862,13 +863,13 @@ func newWorkflowRegistrySyncerV2(
862863
lf,
863864
artifactsV2.WithMaxArtifactSize(
864865
artifactsV2.ArtifactConfig{
865-
MaxBinarySize: uint64(capCfg.WorkflowRegistry().MaxBinarySize()),
866-
MaxSecretsSize: uint64(capCfg.WorkflowRegistry().MaxEncryptedSecretsSize()),
867-
MaxConfigSize: uint64(capCfg.WorkflowRegistry().MaxConfigSize()),
866+
MaxBinarySize: uint64(wfReg.MaxBinarySize()),
867+
MaxSecretsSize: uint64(wfReg.MaxEncryptedSecretsSize()),
868+
MaxConfigSize: uint64(wfReg.MaxConfigSize()),
868869
},
869870
),
870871
artifactsV2.WithConfig(artifactsV2.StoreConfig{
871-
ArtifactStorageHost: capCfg.WorkflowRegistry().WorkflowStorage().ArtifactStorageHost(),
872+
ArtifactStorageHost: wfReg.WorkflowStorage().ArtifactStorageHost(),
872873
}),
873874
)
874875
if err != nil {
@@ -887,7 +888,7 @@ func newWorkflowRegistrySyncerV2(
887888
return nil, nil, fmt.Errorf("could not instantiate engine feature flags: %w", err)
888889
}
889890

890-
selector, err := chainSelector(capCfg.WorkflowRegistry().ChainID(), capCfg.WorkflowRegistry().NetworkID())
891+
selector, err := chainSelector(wfReg.ChainID(), wfReg.NetworkID())
891892
if err != nil {
892893
return nil, nil, fmt.Errorf("failed to get workflow registry chain details by chain ID and network ID: %w", err)
893894
}
@@ -937,7 +938,7 @@ func newWorkflowRegistrySyncerV2(
937938
key,
938939
workflowDonNotifier,
939940
syncerV2.WithBillingClient(billingClient),
940-
syncerV2.WithWorkflowRegistry(capCfg.WorkflowRegistry().Address(), selector),
941+
syncerV2.WithWorkflowRegistry(wfReg.Address(), selector),
941942
syncerV2.WithOrgResolver(orgResolver),
942943
syncerV2.WithDebugMode(cfg.CRE().DebugMode()),
943944
syncerV2.WithLocalSecrets(lggr, cfg.CRE().LocalSecrets()),
@@ -948,7 +949,7 @@ func newWorkflowRegistrySyncerV2(
948949
return nil, nil, fmt.Errorf("unable to create workflow registry event handler: %w", err)
949950
}
950951

951-
addSources := capCfg.WorkflowRegistry().AdditionalSources()
952+
addSources := wfReg.AdditionalSources()
952953
addSourceConfigs := make([]syncerV2.AdditionalSourceConfig, len(addSources))
953954
for i, src := range addSources {
954955
addSourceConfigs[i] = syncerV2.AdditionalSourceConfig{
@@ -962,7 +963,7 @@ func newWorkflowRegistrySyncerV2(
962963
registryOpts := []syncerV2.Option{
963964
syncerV2.WithAdditionalSources(addSourceConfigs),
964965
syncerV2.WithShardOrchestratorClient(shardOrchestratorClient),
965-
syncerV2.WithMaxConcurrency(capCfg.WorkflowRegistry().MaxConcurrency()),
966+
syncerV2.WithMaxConcurrency(wfReg.MaxConcurrency()),
966967
}
967968
if cfg.Sharding().ShardingEnabled() {
968969
registryOpts = append(registryOpts,
@@ -977,11 +978,11 @@ func newWorkflowRegistrySyncerV2(
977978
workflowRegistrySyncerV2, err := syncerV2.NewWorkflowRegistry(
978979
lggr,
979980
crFactory,
980-
capCfg.WorkflowRegistry().Address(),
981+
wfReg.Address(),
981982
selector,
982983
syncerV2.Config{
983984
QueryCount: 100,
984-
SyncStrategy: syncerV2.SyncStrategy(capCfg.WorkflowRegistry().SyncStrategy()),
985+
SyncStrategy: syncerV2.SyncStrategy(wfReg.SyncStrategy()),
985986
},
986987
eventHandler,
987988
workflowDonNotifier,

0 commit comments

Comments
 (0)