fix status
This commit is contained in:
parent
90b406b066
commit
24b3a88576
@ -25,7 +25,7 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
updateInterval = time.Millisecond * 300
|
||||
updateInterval = time.Millisecond * 700
|
||||
sizeMB int64 = 1024 * 1024
|
||||
)
|
||||
|
||||
@ -80,7 +80,7 @@ func (m *Main) log(text string) {
|
||||
m.logger.Println(time.Now().UTC().Format("2006-01-02 15:04:05"), text)
|
||||
}
|
||||
|
||||
func (m *Main) logStatus(stat chkbit.Status, path string) {
|
||||
func (m *Main) logStatus(stat chkbit.Status, path string) bool {
|
||||
if stat == chkbit.STATUS_UPDATE_INDEX {
|
||||
m.numIdxUpd++
|
||||
} else {
|
||||
@ -108,8 +108,10 @@ func (m *Main) logStatus(stat chkbit.Status, path string) {
|
||||
col = termAlertFG
|
||||
}
|
||||
lterm.Printline(col, stat.String(), " ", path, lterm.Reset)
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *Main) showStatus(context *chkbit.Context) {
|
||||
@ -124,12 +126,13 @@ func (m *Main) showStatus(context *chkbit.Context) {
|
||||
}
|
||||
return
|
||||
}
|
||||
m.logStatus(item.Stat, item.Message)
|
||||
if m.logStatus(item.Stat, item.Message) {
|
||||
if m.progress == Fancy {
|
||||
lterm.Write(termBG, termFG1, stat, lterm.ClearLine(0), lterm.Reset, "\r")
|
||||
} else {
|
||||
fmt.Print(m.total, "\r")
|
||||
}
|
||||
}
|
||||
case perf := <-context.PerfQueue:
|
||||
now := time.Now()
|
||||
m.fps.Push(now, perf.NumFiles)
|
||||
|
@ -10,4 +10,4 @@ mv $root/root/people $root/people
|
||||
ln -s ../people people
|
||||
ln -s ../../people/face/office-door.pdf day/friend/office-door.pdf
|
||||
|
||||
find -L | wc -l
|
||||
find -L -type f | wc -l
|
||||
|
@ -16,6 +16,6 @@ fi
|
||||
|
||||
$script_dir/build
|
||||
|
||||
"$base_dir/chkbit" -u /tmp/chkbit
|
||||
# todo: validate
|
||||
"$base_dir/chkbit" -u /tmp/chkbit/root
|
||||
# todo: validate (300 files, 1 symlink dir followed, 1 symlink file ignored)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user