mirror of
https://github.com/rclone/rclone.git
synced 2024-11-24 09:24:05 +01:00
rc: fix stats groups being ignored in operations/check
Before this change operations/check was using a background context for the checking which was causing the stats group to be ignored. This fixes the problem and also a similar problem in backend/command See: https://forum.rclone.org/t/operations-check-only-reports-to-global-stats-not-per-job-group/45254
This commit is contained in:
parent
efed6b01d2
commit
215ae17272
@ -639,7 +639,7 @@ func rcBackend(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result, err := doCommand(context.Background(), command, arg, opt)
|
||||
result, err := doCommand(ctx, command, arg, opt)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("command %q failed: %w", command, err)
|
||||
|
||||
@ -858,13 +858,13 @@ func rcCheck(ctx context.Context, in rc.Params) (out rc.Params, err error) {
|
||||
|
||||
if checkFileHash != "" {
|
||||
out["hashType"] = checkFileHashType.String()
|
||||
err = CheckSum(context.Background(), dstFs, checkFileFs, checkFileRemote, checkFileHashType, opt, download)
|
||||
err = CheckSum(ctx, dstFs, checkFileFs, checkFileRemote, checkFileHashType, opt, download)
|
||||
} else {
|
||||
if download {
|
||||
err = CheckDownload(context.Background(), opt)
|
||||
err = CheckDownload(ctx, opt)
|
||||
} else {
|
||||
out["hashType"] = srcFs.Hashes().Overlap(dstFs.Hashes()).GetOne().String()
|
||||
err = Check(context.Background(), opt)
|
||||
err = Check(ctx, opt)
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user