aboutsummaryrefslogtreecommitdiff
path: root/object/store/dual/quarantine_begin.go
blob: 143bd57d16da5c55bbf89e3433e5328eaa4dd292 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package dual

import objectstore "codeberg.org/lindenii/furgit/object/store"

// BeginQuarantine creates one coordinated dual quarantine spanning both stores.
//
// Labels: Deps-Borrowed, Life-Parent, Close-No.
func (dual *Dual) BeginQuarantine(opts objectstore.QuarantineOptions) (objectstore.WriterQuarantine, error) {
	objectQ, err := dual.object.BeginObjectQuarantine(opts.Object)
	if err != nil {
		return nil, err
	}

	packQ, err := dual.pack.BeginPackQuarantine(opts.Pack)
	if err != nil {
		_ = objectQ.Discard()

		return nil, err
	}

	return newQuarantine(objectQ, packQ), nil
}