make summary available externally
This commit is contained in:
parent
7d8772ed63
commit
557c595e90
1 changed files with 9 additions and 3 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue