21126: Add AllowTrashWhenReadOnly flag.
[arvados.git] / services / keepstore / keepstore.go
index f83ba603d2fd0edb874318176b0120d805c0cab0..953aa047cbfa6ab6f7b55630aa30e83732adaf0e 100644 (file)
@@ -49,7 +49,9 @@ func (e *KeepError) Error() string {
 func emptyTrash(mounts []*VolumeMount, interval time.Duration) {
        for range time.NewTicker(interval).C {
                for _, v := range mounts {
-                       v.EmptyTrash()
+                       if v.KeepMount.AllowTrash {
+                               v.EmptyTrash()
+                       }
                }
        }
 }