diff --git a/state/dsstate/datastore.go b/state/dsstate/datastore.go index 8a494879..271d7cdc 100644 --- a/state/dsstate/datastore.go +++ b/state/dsstate/datastore.go @@ -140,6 +140,7 @@ func (st *State) List(ctx context.Context) ([]*api.Pin, error) { var pins []*api.Pin + total := 0 for r := range results.Next() { if r.Error != nil { logger.Errorf("error in query result: %s", r.Error) @@ -158,8 +159,15 @@ func (st *State) List(ctx context.Context) ([]*api.Pin, error) { continue } + if total > 0 && total%500000 == 0 { + logger.Infof("Full pinset listing in progress: %d pins so far", total) + } + total++ pins = append(pins, p) } + if total >= 500000 { + logger.Infof("Full pinset listing finished: %d pins", total) + } return pins, nil }