shorter log lines
parent
8aeab5ada5
commit
582e35b237
|
|
@ -8,27 +8,30 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func One(ctx context.Context, p string) error {
|
func One(ctx context.Context, p string) error {
|
||||||
|
shortp := path.Join("...", path.Dir(p), path.Base(p))
|
||||||
|
|
||||||
last, err := checkLast(ctx, p)
|
last, err := checkLast(ctx, p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if last.T.IsZero() {
|
if last.T.IsZero() {
|
||||||
log.Printf("asses.One(%s) // never seen before", p)
|
log.Printf("asses.One(%s) // never seen before", shortp)
|
||||||
} else if cksum, err := Cksum(p); err != nil {
|
} else if cksum, err := Cksum(p); err != nil {
|
||||||
return err
|
return err
|
||||||
} else if cksum != last.Cksum {
|
} else if cksum != last.Cksum {
|
||||||
log.Printf("asses.One(%s) // cksum changed", p)
|
log.Printf("asses.One(%s) // cksum changed", shortp)
|
||||||
} else if threshold := 20 + time.Duration(rand.Int()%10)*24*time.Hour; time.Since(last.T) < threshold {
|
} else if threshold := 20 + time.Duration(rand.Int()%10)*24*time.Hour; time.Since(last.T) < threshold {
|
||||||
log.Printf("asses.One(%s) // lt %v since last review", p, threshold)
|
log.Printf("asses.One(%s) // lt %v since last review", shortp, threshold.Hours())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("asses.deport(%s)...", p)
|
log.Printf("asses.deport(%s)...", shortp)
|
||||||
if err := deport(ctx, p); err != nil {
|
if err := deport(ctx, p); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue