fix(typesense): don't try to index tasks if there are none

This commit is contained in:
kolaente 2023-09-13 12:19:09 +02:00
parent 38a3a5c6e8
commit 054f21821c
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 6 additions and 0 deletions

View File

@ -243,6 +243,12 @@ func ReindexAllTasks() (err error) {
}
func reindexTasks(s *xorm.Session, tasks map[int64]*Task) (err error) {
if len(tasks) == 0 {
log.Infof("No tasks to index")
return
}
err = addMoreInfoToTasks(s, tasks, &user.User{ID: 1})
if err != nil {
return fmt.Errorf("could not fetch more task info: %s", err.Error())