Close decreases the ref count on this store, and if the count is 0 proceeds to actually close the store.
()
| 283 | // Close decreases the ref count on this store, and if the count is 0 |
| 284 | // proceeds to actually close the store. |
| 285 | func (s *Store) Close() error { |
| 286 | s.m.Lock() |
| 287 | defer s.m.Unlock() |
| 288 | |
| 289 | s.refs-- |
| 290 | if s.refs > 0 || s.footer == nil { |
| 291 | return nil |
| 292 | } |
| 293 | |
| 294 | footer := s.footer |
| 295 | s.footer = nil |
| 296 | |
| 297 | return footer.Close() |
| 298 | } |
| 299 | |
| 300 | // CloseEx provides more advanced closing options. |
| 301 | func (s *Store) CloseEx(options StoreCloseExOptions) error { |