Skip to content

Commit

Permalink
Programmatic way of knowing that Conduit has been initialized (#1224)
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso authored Sep 29, 2023
1 parent 991653e commit 4bae904
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pkg/conduit/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ type Runtime struct {
DB database.DB
Orchestrator *orchestrator.Orchestrator
ProvisionService *provisioning.Service
// Ready will be closed when Runtime has successfully started
Ready chan struct{}

pipelineService *pipeline.Service
connectorService *connector.Service
processorService *processor.Service
pluginService *plugin.Service

connectorPersister *connector.Persister
pluginService *plugin.Service

logger log.CtxLogger
connectorPersister *connector.Persister
logger log.CtxLogger
}

// NewRuntime sets up a Runtime instance and primes it for start.
Expand Down Expand Up @@ -141,6 +143,7 @@ func NewRuntime(cfg Config) (*Runtime, error) {
DB: db,
Orchestrator: orc,
ProvisionService: provisionService,
Ready: make(chan struct{}),

pipelineService: plService,
connectorService: connService,
Expand Down Expand Up @@ -277,6 +280,7 @@ func (r *Runtime) Run(ctx context.Context) (err error) {
r.logger.Info(ctx).Send()
}

close(r.Ready)
return nil
}

Expand Down

0 comments on commit 4bae904

Please sign in to comment.