return: ExecRowCount, TotalRowCount
(jobName string)
| 649 | |
| 650 | // return: ExecRowCount, TotalRowCount |
| 651 | func (sm *StoreManager) GetDumpProgress(jobName string) (int64, int64, error) { |
| 652 | key := fmt.Sprintf("dtle/%v/DumpProgress", jobName) |
| 653 | kv, err:= sm.consulStore.Get(key) |
| 654 | if err == store.ErrKeyNotFound { |
| 655 | return 0, 0, nil |
| 656 | } else if err != nil { |
| 657 | return 0, 0, err |
| 658 | } |
| 659 | |
| 660 | var r []int64 |
| 661 | err = json.Unmarshal(kv.Value, &r) |
| 662 | if err != nil { |
| 663 | return 0, 0, err |
| 664 | } |
| 665 | if len(r) != 2 { |
| 666 | return 0, 0, fmt.Errorf("unexpected len for %v. found %v", key, len(r)) |
| 667 | } |
| 668 | |
| 669 | return r[0], r[1], nil |
| 670 | } |
| 671 | |
| 672 | // consul store item |
| 673 |
no test coverage detected