Add periodic log message for loading items during restore (#3282)

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [x] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

*

#### Test Plan

- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-05-02 14:53:37 -07:00 committed by GitHub
parent c152ce8b25
commit 5f43287feb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -413,6 +413,7 @@ func (w Wrapper) ProduceRestoreCollections(
} }
var ( var (
loadCount int
// Maps short ID of parent path to data collection for that folder. // Maps short ID of parent path to data collection for that folder.
cols = map[string]*kopiaDataCollection{} cols = map[string]*kopiaDataCollection{}
el = errs.Local() el = errs.Local()
@ -451,6 +452,11 @@ func (w Wrapper) ProduceRestoreCollections(
} }
c.streams = append(c.streams, ds) c.streams = append(c.streams, ds)
loadCount++
if loadCount%1000 == 0 {
logger.Ctx(ctx).Infow("loading items from kopia", "loaded_count", loadCount)
}
} }
// Can't use the maps package to extract the values because we need to convert // Can't use the maps package to extract the values because we need to convert
@ -460,6 +466,8 @@ func (w Wrapper) ProduceRestoreCollections(
res = append(res, c) res = append(res, c)
} }
logger.Ctx(ctx).Infow("done loading items from kopia", "loaded_count", loadCount)
return res, el.Failure() return res, el.Failure()
} }