aboutsummaryrefslogtreecommitdiff
path: root/object/store/packed/quarantine_discard.go
diff options
context:
space:
mode:
Diffstat (limited to 'object/store/packed/quarantine_discard.go')
-rw-r--r--object/store/packed/quarantine_discard.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/object/store/packed/quarantine_discard.go b/object/store/packed/quarantine_discard.go
new file mode 100644
index 00000000..a1dc7310
--- /dev/null
+++ b/object/store/packed/quarantine_discard.go
@@ -0,0 +1,18 @@
+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
+}