Skip to content

Commit 7657445

Browse files
committed
Minor: improved logging
1 parent 14bd5f0 commit 7657445

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

internal/workflow/task_data.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ func (td *TaskData) Save(reqId ReqId, task TaskId) error {
6868
}
6969
// saves the json object into etcd
7070
key := getTaskDataEtcdKey(reqId, task)
71-
//log.Printf("Saving PD on etcd : %v\n", td.Data)
72-
log.Printf("Saving PD on etcd with key: %s and payload: %v\n", key, string(payload))
71+
log.Printf("Saving PD on etcd with key: %s\n", key)
7372

7473
_, err = cli.Put(ctx, key, string(payload))
7574
if err != nil {
@@ -89,7 +88,7 @@ func RetrievePartialData(reqId ReqId, task TaskId) (*TaskData, error) {
8988
log.Printf("Retrieving partial data with key: %s\n", key)
9089
getResponse, err := cli.Get(ctx, key)
9190
if err != nil {
92-
return nil, fmt.Errorf("failed to retrieve partialDatas for requestId: %s", key)
91+
return nil, fmt.Errorf("failed to retrieve PD for requestId %s: %v", key, err)
9392
}
9493
if len(getResponse.Kvs) > 1 {
9594
return nil, fmt.Errorf("more than 1 TaskData associated with key: %s", key)

internal/workflow/workflow.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,17 +500,16 @@ func (wflow *Workflow) Invoke(r *Request) error {
500500
}
501501

502502
if input != nil {
503-
return fmt.Errorf("Merge of inputs not supported yet!")
503+
return fmt.Errorf("merge of inputs not supported yet!")
504504
}
505505

506506
input, found = dataMap[previousTask]
507507
if !found {
508508
log.Printf("Input not found in dataMap for previousTask %s", previousTask)
509509
input, err = RetrievePartialData(requestId, previousTask)
510510
if err != nil {
511-
return fmt.Errorf("Could not retrieve partial data: %v", err)
511+
return fmt.Errorf("could not retrieve partial data: %v", err)
512512
}
513-
log.Printf("Input retrieved from etcd: %s", input)
514513
}
515514
}
516515
}

0 commit comments

Comments
 (0)