mirror of
https://github.com/restic/restic.git
synced 2025-08-23 14:57:37 +00:00
replace ad-hoc context.TODO() with gopts.ctx, so that cancellation
can properly trickle down from cmd_*. gh-1434
This commit is contained in:
@@ -89,7 +89,7 @@ func (r *packerManager) insertPacker(p *Packer) {
|
||||
}
|
||||
|
||||
// savePacker stores p in the backend.
|
||||
func (r *Repository) savePacker(t restic.BlobType, p *Packer) error {
|
||||
func (r *Repository) savePacker(ctx context.Context, t restic.BlobType, p *Packer) error {
|
||||
debug.Log("save packer for %v with %d blobs (%d bytes)\n", t, p.Packer.Count(), p.Packer.Size())
|
||||
_, err := p.Packer.Finalize()
|
||||
if err != nil {
|
||||
@@ -104,7 +104,7 @@ func (r *Repository) savePacker(t restic.BlobType, p *Packer) error {
|
||||
id := restic.IDFromHash(p.hw.Sum(nil))
|
||||
h := restic.Handle{Type: restic.DataFile, Name: id.String()}
|
||||
|
||||
err = r.be.Save(context.TODO(), h, p.tmpfile)
|
||||
err = r.be.Save(ctx, h, p.tmpfile)
|
||||
if err != nil {
|
||||
debug.Log("Save(%v) error: %v", h, err)
|
||||
return err
|
||||
|
Reference in New Issue
Block a user