diff --git a/reflector/uploader.go b/reflector/uploader.go index 5ad4421..22ef274 100644 --- a/reflector/uploader.go +++ b/reflector/uploader.go @@ -24,6 +24,10 @@ const ( errInc ) +type Summary struct { + total, alreadyStored, sd, blob, err int +} + type Uploader struct { db *db.SQL store *store.DBBackedS3Store // could just be store.BlobStore interface @@ -32,9 +36,7 @@ type Uploader struct { stopper *stop.Group countChan chan increment - count struct { - total, alreadyStored, sd, blob, err int - } + count Summary } func NewUploader(db *db.SQL, store *store.DBBackedS3Store, workers int, skipExistsCheck bool) *Uploader { @@ -211,6 +213,10 @@ func (u *Uploader) counter() { } } +func (u *Uploader) GetSummary() Summary { + return u.count +} + func (u *Uploader) inc(t increment) { select { case u.countChan <- t: