Skip to content

Commit cc9f890

Browse files
authored
Refactored execute job function (#4)
1 parent ac9fec5 commit cc9f890

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

sdk.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,18 @@ func (GRPCServer) ExecuteJob(ctx context.Context, j *proto.Job) (*proto.JobResul
9494
if err != nil {
9595
// Check if job wants to force exit pipeline.
9696
// We will exit the pipeline but not mark as 'failed'.
97-
if err == ErrorExitPipeline {
98-
r.ExitPipeline = true
99-
} else {
97+
if err != ErrorExitPipeline {
10098
// We got an error. Pipeline is now marked as 'failed'.
101-
r.ExitPipeline = true
10299
r.Failed = true
103100
}
104101

105102
// Set log message and job id
103+
r.ExitPipeline = true
106104
r.Message = err.Error()
107105
r.UniqueId = job.job.UniqueId
108106
}
109107

110-
return r, err
108+
return r, nil
111109
}
112110

113111
// Serve initiates the gRPC Server and listens.

0 commit comments

Comments
 (0)