Close closes all opened files.
()
| 644 | |
| 645 | // Close closes all opened files. |
| 646 | func (s *ObjectStorage) Close() error { |
| 647 | var firstError error |
| 648 | if s.options.KeepDescriptors || s.options.MaxOpenDescriptors > 0 { |
| 649 | for _, packfile := range s.packfiles { |
| 650 | err := packfile.Close() |
| 651 | if firstError == nil && err != nil { |
| 652 | firstError = err |
| 653 | } |
| 654 | } |
| 655 | } |
| 656 | |
| 657 | s.packfiles = nil |
| 658 | s.dir.Close() |
| 659 | |
| 660 | return firstError |
| 661 | } |
| 662 | |
| 663 | type lazyPackfilesIter struct { |
| 664 | hashes []plumbing.Hash |