summaryrefslogtreecommitdiff
path: root/plugins/jobs/rpc.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-09-02 19:04:16 +0300
committerValery Piashchynski <[email protected]>2021-09-02 19:04:16 +0300
commitda78c9ed8ee7406aa2de21bc70642928c391852a (patch)
tree34e755cd1f01d9573486cb6cbb386ce43fbd727c /plugins/jobs/rpc.go
parentc64005501f92888c10a61481745df91c7c50639f (diff)
Do not use copied driver from the map.
Store driver and pipeline only after run w/o error. Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/rpc.go')
-rw-r--r--plugins/jobs/rpc.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/jobs/rpc.go b/plugins/jobs/rpc.go
index 62186981..d7b93bd1 100644
--- a/plugins/jobs/rpc.go
+++ b/plugins/jobs/rpc.go
@@ -25,7 +25,7 @@ func (r *rpc) Push(j *jobsv1beta.PushRequest, _ *jobsv1beta.Empty) error {
return errors.E(op, errors.Str("empty ID field not allowed"))
}
- err := r.p.Push(r.from(j.GetJob()))
+ err := r.p.Push(from(j.GetJob()))
if err != nil {
return errors.E(op, err)
}
@@ -43,7 +43,7 @@ func (r *rpc) PushBatch(j *jobsv1beta.PushBatchRequest, _ *jobsv1beta.Empty) err
for i := 0; i < l; i++ {
// convert transport entity into domain
// how we can do this quickly
- batch[i] = r.from(j.GetJobs()[i])
+ batch[i] = from(j.GetJobs()[i])
}
err := r.p.PushBatch(batch)
@@ -137,7 +137,7 @@ func (r *rpc) Stat(_ *jobsv1beta.Empty, resp *jobsv1beta.Stats) error {
}
// from converts from transport entity to domain
-func (r *rpc) from(j *jobsv1beta.Job) *job.Job {
+func from(j *jobsv1beta.Job) *job.Job {
headers := make(map[string][]string, len(j.GetHeaders()))
for k, v := range j.GetHeaders() {