log asses.Main new dir processing
parent
9c0129f968
commit
6626077201
|
|
@ -50,7 +50,7 @@ func One(ctx context.Context, p string) error {
|
||||||
} else if stat, err := os.Stat(p); err != nil {
|
} else if stat, err := os.Stat(p); err != nil {
|
||||||
return fmt.Errorf("cannot stat %s: %w", p, err)
|
return fmt.Errorf("cannot stat %s: %w", p, err)
|
||||||
} else if stat.ModTime() == last.Modified {
|
} else if stat.ModTime() == last.Modified {
|
||||||
log.Printf("asses.One(%s) // unmodified since %v", shortp, last.T)
|
//log.Printf("asses.One(%s) // unmodified since %v", shortp, last.T)
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
log.Printf("asses.One(%s) // modified (%v) is now %v", shortp, last.Modified, stat.ModTime())
|
log.Printf("asses.One(%s) // modified (%v) is now %v", shortp, last.Modified, stat.ModTime())
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package asses
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
|
"log"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"show-rss/src/asses"
|
"show-rss/src/asses"
|
||||||
|
|
@ -24,7 +25,14 @@ func One(ctx context.Context) error {
|
||||||
ctx, can := context.WithDeadline(ctx, asses.Deadline())
|
ctx, can := context.WithDeadline(ctx, asses.Deadline())
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
return OneWith(ctx, rootDs, asses.One)
|
lastD := ""
|
||||||
|
return OneWith(ctx, rootDs, func(ctx context.Context, p string) error {
|
||||||
|
if d := path.Dir(p); d != lastD {
|
||||||
|
log.Printf("asses.One(%s/...)...", d)
|
||||||
|
lastD = d
|
||||||
|
}
|
||||||
|
return asses.One(ctx, p)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func OneWith(ctx context.Context, rootds []string, cb CB) error {
|
func OneWith(ctx context.Context, rootds []string, cb CB) error {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue