run starts a task and blocks till it completes.
()
| 306 | |
| 307 | // run starts a task and blocks till it completes. |
| 308 | func (t *taskRequest) run() error { |
| 309 | switch req := t.req.(type) { |
| 310 | case *pb.BackupRequest: |
| 311 | if err := ProcessBackupRequest(context.Background(), req); err != nil { |
| 312 | return err |
| 313 | } |
| 314 | case *pb.ExportRequest: |
| 315 | files, err := ExportOverNetwork(context.Background(), req) |
| 316 | if err != nil { |
| 317 | return err |
| 318 | } |
| 319 | glog.Infof("task %#x: exported files: %v", t.id, files) |
| 320 | default: |
| 321 | glog.Errorf( |
| 322 | "task %#x: received request of unknown type (%T)", t.id, reflect.TypeOf(t.req)) |
| 323 | } |
| 324 | return nil |
| 325 | } |
| 326 | |
| 327 | // TaskMeta stores a timestamp, a TaskKind and a Status. |
| 328 | // |
nothing calls this directly
no test coverage detected