| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package coordinator | 5 package coordinator |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "fmt" | 9 "fmt" |
| 10 "time" | 10 "time" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 dg.Data = aggregate | 307 dg.Data = aggregate |
| 308 dg.Partial = nil | 308 dg.Partial = nil |
| 309 return le, nil | 309 return le, nil |
| 310 } | 310 } |
| 311 | 311 |
| 312 func loadStatePointer(stateP *LogStream, resp *logdog.GetResponse) error { | 312 func loadStatePointer(stateP *LogStream, resp *logdog.GetResponse) error { |
| 313 if stateP == nil { | 313 if stateP == nil { |
| 314 return nil | 314 return nil |
| 315 } | 315 } |
| 316 | 316 |
| 317 // The service should always return this when requested, but handle the
case |
| 318 // where it doesn't for completeness. |
| 319 if resp.Desc == nil { |
| 320 return errors.New("descriptor was not returned") |
| 321 } |
| 322 |
| 317 ls, err := loadLogStream(resp.Project, resp.Desc.Path(), resp.State, res
p.Desc) | 323 ls, err := loadLogStream(resp.Project, resp.Desc.Path(), resp.State, res
p.Desc) |
| 318 if err != nil { | 324 if err != nil { |
| 319 » » return fmt.Errorf("failde to load stream state: %v", err) | 325 » » return fmt.Errorf("failed to load stream state: %v", err) |
| 320 } | 326 } |
| 321 | 327 |
| 322 *stateP = *ls | 328 *stateP = *ls |
| 323 return nil | 329 return nil |
| 324 } | 330 } |
| OLD | NEW |