[ARVADOS] updated: 7309faba0c878f9ae8a195e089eb6e71dc1d197a
Git user
git at public.curoverse.com
Wed Mar 16 12:42:30 EDT 2016
Summary of changes:
services/keepstore/volume_unix.go | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
discards 325b6c7b443991fc8d377dbe0dc82d4d17ae5c26 (commit)
via 7309faba0c878f9ae8a195e089eb6e71dc1d197a (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (325b6c7b443991fc8d377dbe0dc82d4d17ae5c26)
\
N -- N -- N (7309faba0c878f9ae8a195e089eb6e71dc1d197a)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
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 7309faba0c878f9ae8a195e089eb6e71dc1d197a
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Mar 16 12:41:56 2016 -0400
8554: Un-pyramid code
diff --git a/services/keepstore/volume_unix.go b/services/keepstore/volume_unix.go
index ba9f27e..561eb41 100644
--- a/services/keepstore/volume_unix.go
+++ b/services/keepstore/volume_unix.go
@@ -552,31 +552,30 @@ 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
+ }
+ bytesInTrash += info.Size()
+ blocksInTrash++
+ if deadline > time.Now().Unix() {
+ return nil
+ }
+ err = os.Remove(path)
+ if err != nil {
+ log.Printf("EmptyTrash: Remove %v: %v", path, err)
+ return nil
}
+ bytesDeleted += info.Size()
+ blocksDeleted++
return nil
})
@@ -584,5 +583,5 @@ func (v *UnixVolume) EmptyTrash() {
log.Printf("EmptyTrash error for %v: %v", v.String(), err)
}
- log.Printf("EmptyTrash stats for %v: Bytes deleted %v; Blocks deleted %v; Bytes remaining in trash: %v; Blocks remaining in trash: %v", v.String(), bytesDeleted, blocksDeleted, bytesInTrash, blocksInTrash)
+ log.Printf("EmptyTrash stats for %v: Deleted %v bytes in %v blocks. Remaining in trash: %v bytes in %v blocks.", v.String(), bytesDeleted, blocksDeleted, bytesInTrash-bytesDeleted, blocksInTrash-blocksDeleted)
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list