Skip to content

Commit

Permalink
Print deleted files stats
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Shishkin <me@teran.ru>
  • Loading branch information
teran committed May 14, 2019
1 parent 3cc3eae commit 8dd5270
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ var (
db *database.Database
filePattern *regexp.Regexp

cntAdded uint64
cntFailed uint64
cntMissed uint64
cntPassed uint64
cntAdded uint64
cntDeleted uint64
cntFailed uint64
cntMissed uint64
cntPassed uint64
)

func main() {
Expand Down Expand Up @@ -98,6 +99,7 @@ func main() {
if cfg.DeleteMissed {
fmt.Printf("%s DeleteMissed requested: deleting file `%s` from database\n", color.BlueString("[NOTE]"), file)
db.DeleteOne(file)
atomic.AddUint64(&cntDeleted, 1)
}

atomic.AddUint64(&cntMissed, 1)
Expand Down Expand Up @@ -192,6 +194,7 @@ func main() {
fmt.Printf("------------\n")
fmt.Printf("Job is done:\n")
fmt.Printf(" Added: %d\n", cntAdded)
fmt.Printf(" Deleted: %d\n", cntDeleted)
fmt.Printf(" Missed: %d\n", cntMissed)
fmt.Printf(" Failed: %d\n", cntFailed)
fmt.Printf(" Passed: %d\n", cntPassed)
Expand Down

0 comments on commit 8dd5270

Please sign in to comment.