Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 52bb5d44f8 | |||
| 825c751775 |
@@ -173,7 +173,7 @@ type objectsProgress struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newObjectsProgress(cnt int) *objectsProgress {
|
func newObjectsProgress(cnt int) *objectsProgress {
|
||||||
return &objectsProgress{TotalCnt: cnt, Processing: map[string]struct{}{}}
|
return &objectsProgress{TotalCnt: cnt}
|
||||||
}
|
}
|
||||||
|
|
||||||
// newProgressInfo constructs a progressInfo from the Source's Progress information.
|
// newProgressInfo constructs a progressInfo from the Source's Progress information.
|
||||||
@@ -208,6 +208,9 @@ func (p *progressInfo) setProcessStatus(obj object, fn progressStateFn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setProcessingBucketObject(bucket, obj string, progress *progressInfo) {
|
func setProcessingBucketObject(bucket, obj string, progress *progressInfo) {
|
||||||
|
if progress.bucketObjects[bucket].Processing == nil {
|
||||||
|
progress.bucketObjects[bucket].Processing = make(map[string]struct{})
|
||||||
|
}
|
||||||
progress.processing(bucket, obj)
|
progress.processing(bucket, obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ func TestSourceInit_Enumerate(t *testing.T) {
|
|||||||
assert.Equal(t, uint32(1), source.stats.numBuckets)
|
assert.Equal(t, uint32(1), source.stats.numBuckets)
|
||||||
assert.Equal(t, uint64(5), source.stats.bucketObjects[testBucket])
|
assert.Equal(t, uint64(5), source.stats.bucketObjects[testBucket])
|
||||||
// Ensure progress is initialized correctly.
|
// Ensure progress is initialized correctly.
|
||||||
p := map[string]*objectsProgress{testBucket: {TotalCnt: 5, Processing: map[string]struct{}{}}}
|
p := map[string]*objectsProgress{testBucket: {IsBucketProcessed: false, ProcessedCnt: 0, TotalCnt: 5}}
|
||||||
b, err := json.Marshal(p)
|
b, err := json.Marshal(p)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
assert.Equal(t, string(b), source.Progress.EncodedResumeInfo)
|
assert.Equal(t, string(b), source.Progress.EncodedResumeInfo)
|
||||||
|
|||||||
Reference in New Issue
Block a user