(w *CloneWrapper)
| 438 | } |
| 439 | |
| 440 | func (c *Base) refreshCloneMetadata(w *CloneWrapper) { |
| 441 | if w == nil || w.Session == nil || w.Clone == nil { |
| 442 | // Not started yet. |
| 443 | return |
| 444 | } |
| 445 | |
| 446 | sessionState, err := c.provision.GetSessionState(w.Session, w.Clone.Branch, w.Clone.ID) |
| 447 | if err != nil { |
| 448 | // Session not ready yet. |
| 449 | log.Err(fmt.Errorf("failed to get session state: %w", err)) |
| 450 | |
| 451 | return |
| 452 | } |
| 453 | |
| 454 | c.cloneMutex.Lock() |
| 455 | w.Clone.Metadata.CloneDiffSize = sessionState.CloneDiffSize |
| 456 | w.Clone.Metadata.LogicalSize = sessionState.LogicalReferenced |
| 457 | c.cloneMutex.Unlock() |
| 458 | } |
| 459 | |
| 460 | // UpdateClone updates clone. |
| 461 | func (c *Base) UpdateClone(id string, patch types.CloneUpdateRequest) (*models.Clone, error) { |
no test coverage detected