This commit is contained in:
Liang Ding 2022-06-13 16:27:34 +08:00
parent 596ea7689a
commit c269c10442
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 17 additions and 2 deletions

View file

@ -50,6 +50,18 @@ func InitRepoKey() (err error) {
return
}
var indexCallbacks = map[string]dejavu.Callback{
"walkData": func(context, arg interface{}, err error) {
context.(func(msg string))(arg.(string))
},
"getLatestFile": func(context, arg interface{}, err error) {
context.(func(msg string))(arg.(string))
},
"upsertFile": func(context, arg interface{}, err error) {
context.(func(msg string))(arg.(string))
},
}
func IndexRepo(message string) (err error) {
if 1 > len(Conf.Repo.Key) {
err = errors.New("repo key is nil")
@ -61,6 +73,7 @@ func IndexRepo(message string) (err error) {
return
}
_, err = repo.Index(message)
_, err = repo.Index(message, util.PushEndlessProgress, indexCallbacks)
util.PushClearProgress()
return
}