Add progress report for loading blobs

This commit is contained in:
Alexander Neumann 2015-02-21 15:32:48 +01:00
parent 58cded6b75
commit a59b0ec1f6
5 changed files with 76 additions and 20 deletions

View file

@ -422,6 +422,16 @@ func (s Server) Stats() (ServerStats, error) {
return ServerStats{Blobs: uint(blobs.Len()), Trees: uint(trees)}, err
}
// Count counts the number of objects of type t in the backend.
func (s Server) Count(t backend.Type) (int, error) {
l, err := s.be.List(t)
if err != nil {
return 0, err
}
return len(l), nil
}
// Proxy methods to backend
func (s Server) List(t backend.Type) (backend.IDs, error) {