-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d7ff26
commit c8d7b2f
Showing
4 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,10 +43,18 @@ func (w *WorkflowRegistry) Start(ctx context.Context) error { | |
go func() { | ||
w.Logger.Info("starting hardcoded workflow...") | ||
|
||
// HACK: don't load the workflow if we aren't a workflow node. | ||
_, err := w.Registry.Get(ctx, "[email protected]") | ||
if err != nil { | ||
w.Logger.Info("not a workflow node, skipping hardcoded workflow") | ||
return | ||
} | ||
|
||
moduleConfig := &host.ModuleConfig{Logger: logger.NullLogger, IsUncompressed: true} | ||
spec, err := host.GetWorkflowSpec(ctx, moduleConfig, workflow, config) | ||
if err != nil { | ||
w.Logger.Errorf("failed to get workflow spec", err) | ||
return | ||
} | ||
|
||
cfg := workflows.Config{ | ||
|
@@ -64,10 +72,12 @@ func (w *WorkflowRegistry) Start(ctx context.Context) error { | |
engine, err := workflows.NewEngine(ctx, cfg) | ||
if err != nil { | ||
w.Logger.Errorf("failed to create engine: %w", err) | ||
return | ||
} | ||
err = engine.Start(ctx) | ||
if err != nil { | ||
w.Logger.Errorf("failed to start hardcoded workflow: %w", err) | ||
return | ||
} | ||
w.subServices = []job.ServiceCtx{engine} | ||
}() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters