()
| 730 | } |
| 731 | |
| 732 | func (u *upstream) ExecuteBatchCommand() error { |
| 733 | if u.sync.Options.UploadBatchCmd != "" { |
| 734 | u.sync.log.Infof("Upstream - Execute command '%s %s'", u.sync.Options.UploadBatchCmd, strings.Join(u.sync.Options.UploadBatchArgs, " ")) |
| 735 | |
| 736 | ctx, cancel := context.WithTimeout(u.sync.ctx, time.Minute*10) |
| 737 | defer cancel() |
| 738 | |
| 739 | _, err := u.client.Execute(ctx, &remote.Command{ |
| 740 | Cmd: u.sync.Options.UploadBatchCmd, |
| 741 | Args: u.sync.Options.UploadBatchArgs, |
| 742 | }) |
| 743 | if err != nil { |
| 744 | return errors.Wrap(err, "execute command") |
| 745 | } |
| 746 | |
| 747 | u.sync.log.Infof("Upstream - Done executing command") |
| 748 | } |
| 749 | |
| 750 | return nil |
| 751 | } |
| 752 | |
| 753 | func (u *upstream) updateUploadChanges(files []*FileInformation) []*FileInformation { |
| 754 | newChanges := make([]*FileInformation, 0, len(files)) |
no test coverage detected