diff options
-rw-r--r-- | main.go | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -694,15 +694,17 @@ func cmdDhash(args []string) error { hasher, hexSHA1 := args[1], args[2:] if len(hexSHA1) == 0 { var err error - hexSHA1, err = dbCollectStrings(`SELECT sha1 FROM image - WHERE dhash IS NULL`) + hexSHA1, err = dbCollectStrings(` + SELECT sha1 FROM image WHERE dhash IS NULL`) if err != nil { return err } } - // TODO: Try to run the hasher in parallel, somehow. - // TODO: Show progress in some manner. Perhaps port my propeller code. + pb := newProgressBar(len(hexSHA1)) + defer pb.Stop() + + // TODO: Also run the hasher in parallel, once it becomes a problem. for _, sha1 := range hexSHA1 { pathThumb := thumbPath(sha1) hash, err := makeDhash(hasher, pathThumb) @@ -715,6 +717,8 @@ func cmdDhash(args []string) error { if err != nil { return err } + + pb.Step() } return nil } |