Skip to content

Commit

Permalink
Fix issue with pipeline name save and errors during execution
Browse files Browse the repository at this point in the history
  • Loading branch information
yamalight committed Oct 16, 2024
1 parent e995baf commit d994877
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
17 changes: 11 additions & 6 deletions app/components/pipeline/nodes/output/OutputNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,18 @@ export function OutputNode() {
}, [litlytics, pipeline]);

const doRunPipeline = async () => {
const newPipeline = await litlytics.runPipeline({
onStatus: (status) => setPipelineStatus(status),
});
setPipeline(newPipeline);
try {
const newPipeline = await litlytics.runPipeline({
onStatus: (status) => setPipelineStatus(status),
});
setPipeline(newPipeline);

// write final status to update on end
setPipelineStatus({ status: 'done' });
// write final status to update on end
setPipelineStatus({ status: 'done' });
} catch (err) {
console.error('Error executing pipeline', err);
setPipelineStatus({ status: 'error' });
}
};

const running =
Expand Down
2 changes: 1 addition & 1 deletion app/components/pipeline/nodes/source/SourceNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function SourceNode() {
const source = useMemo(() => {
return pipeline.source;
}, [pipeline.source]);
const docs = useMemo(() => source.docs, [source.docs]);
const docs = useMemo(() => source.docs ?? [], [source.docs]);

const sourceType = useMemo(
() => ((source.config as SourceConfig)?.type ?? 'text') as SourceType,
Expand Down
4 changes: 3 additions & 1 deletion app/components/ui/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ export function OverlayUI() {
placeholder="Pipeline name"
autoFocus
value={pipeline.name}
onChange={(e) => (pipeline.name = e.target.value)}
onChange={(e) =>
setPipeline({ ...pipeline, name: e.target.value })
}
/>
</Field>
</FieldGroup>
Expand Down

0 comments on commit d994877

Please sign in to comment.