Profiling log message for photo search, see #2

This commit is contained in:
Michael Mayer 2019-05-15 22:26:38 +02:00
parent 5eb32d3353
commit 40b542276c

View file

@ -1,14 +1,14 @@
package photoprism
import (
"fmt"
"strings"
"time"
"github.com/jinzhu/gorm"
"github.com/photoprism/photoprism/internal/forms"
"github.com/photoprism/photoprism/internal/models"
log "github.com/sirupsen/logrus"
"github.com/photoprism/photoprism/internal/util"
)
// Search searches given an originals path and a db instance.
@ -102,7 +102,7 @@ func (s *Search) Photos(form forms.PhotoSearchForm) (results []PhotoSearchResult
return results, err
}
log.Infof("%+v\n", form)
defer util.ProfileTime(time.Now(), fmt.Sprintf("search for %+v", form))
q := s.db.NewScope(nil).DB()
q = q.Table("photos").