shithub: furgit

ref: ab174c473618dd3743881cf44e02c2db4d1ecd5f
dir: /object/store/packed/quarantine_discard.go/

View raw version
package packed

// Discard removes the quarantine and invalidates the receiver.
func (quarantine *packQuarantine) Discard() error {
	closeErr := quarantine.Close()
	tempRootErr := quarantine.tempRoot.Close()
	removeErr := quarantine.parent.root.RemoveAll(quarantine.tempName)

	if closeErr != nil {
		return closeErr
	}

	if tempRootErr != nil {
		return tempRootErr
	}

	return removeErr
}