🎨 logging

This commit is contained in:
Liang Ding 2022-06-26 00:00:43 +08:00
parent c78ac2edc2
commit 97c26981b3
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 9 additions and 2 deletions

View file

@ -358,12 +358,17 @@ func IndexRepo(memo string) (err error) {
util.PushEndlessProgress(Conf.Language(143))
writingDataLock.Lock()
defer writingDataLock.Unlock()
start := time.Now()
WaitForWritingFiles()
sql.WaitForWritingDatabase()
filelock.ReleaseAllFileLocks()
_, err = repo.Index(memo, map[string]interface{}{
CtxPushMsg: CtxPushMsgToStatusBarAndProgress,
})
elapsed := time.Since(start)
util.LogInfof("index data repo elapsed [%.2fs]", elapsed.Seconds())
util.PushStatusBar(fmt.Sprintf("Index data repo elapsed [%.2fs]", elapsed.Seconds()))
util.PushClearProgress()
return
}
@ -428,6 +433,6 @@ func syncRepo() (err error) {
})
elapsed := time.Since(start)
util.LogInfof("sync data repo elapsed [%.2fs]", elapsed.Seconds())
util.PushStatusBar(fmt.Sprintf("Sync data data repo elapsed [%.2fs]", elapsed.Seconds()))
util.PushStatusBar(fmt.Sprintf("Sync data repo elapsed [%.2fs]", elapsed.Seconds()))
return
}