[ARVADOS] updated: 325b6c7b443991fc8d377dbe0dc82d4d17ae5c26

Git user git at public.curoverse.com
Wed Mar 16 12:35:11 EDT 2016


Summary of changes:
 services/keepstore/volume_unix.go | 49 ++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 24 deletions(-)

       via  325b6c7b443991fc8d377dbe0dc82d4d17ae5c26 (commit)
      from  9c571f5fcbdf8120c30ab29b1ba3a41f52d37425 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 325b6c7b443991fc8d377dbe0dc82d4d17ae5c26
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Mar 16 12:34:14 2016 -0400

    8554: Un-pyramid code

diff --git a/services/keepstore/volume_unix.go b/services/keepstore/volume_unix.go
index ba9f27e..e90386b 100644
--- a/services/keepstore/volume_unix.go
+++ b/services/keepstore/volume_unix.go
@@ -552,30 +552,31 @@ func (v *UnixVolume) EmptyTrash() {
 		if err != nil {
 			return err
 		}
-
-		if !info.Mode().IsDir() {
-			matches := trashLocRegexp.FindStringSubmatch(path)
-			if len(matches) == 3 {
-				deadline, err := strconv.ParseInt(matches[2], 10, 64)
-				if err != nil {
-					log.Printf("EmptyTrash error for %v: %v", matches[1], err)
-				} else {
-					if deadline <= time.Now().Unix() {
-						err = os.Remove(path)
-						if err != nil {
-							log.Printf("Error deleting %v: %v", matches[1], err)
-							bytesInTrash += info.Size()
-							blocksInTrash++
-						} else {
-							bytesDeleted += info.Size()
-							blocksDeleted++
-						}
-					} else {
-						bytesInTrash += info.Size()
-						blocksInTrash++
-					}
-				}
-			}
+		if info.Mode().IsDir() {
+			return nil
+		}
+		matches := trashLocRegexp.FindStringSubmatch(path)
+		if len(matches) != 3 {
+			return nil
+		}
+		deadline, err := strconv.ParseInt(matches[2], 10, 64)
+		if err != nil {
+			log.Printf("EmptyTrash: %v: ParseInt(%v): %v", path, matches[2], err)
+			return nil
+		}
+		if deadline > time.Now().Unix() {
+			bytesInTrash += info.Size()
+			blocksInTrash++
+			return nil
+		}
+		err = os.Remove(path)
+		if err != nil {
+			log.Printf("EmptyTrash: Remove %v: %v", path, err)
+			bytesInTrash += info.Size()
+			blocksInTrash++
+		} else {
+			bytesDeleted += info.Size()
+			blocksDeleted++
 		}
 		return nil
 	})

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list