Close should be called when the program ends gracefully
()
| 1025 | |
| 1026 | // Close should be called when the program ends gracefully |
| 1027 | func (b *Persistent) Close() { |
| 1028 | b.cleanupMux.Lock() |
| 1029 | defer b.cleanupMux.Unlock() |
| 1030 | |
| 1031 | err := b.db.Close() |
| 1032 | if err != nil { |
| 1033 | fs.Errorf(b, "closing handle: %v", err) |
| 1034 | } |
| 1035 | b.open = false |
| 1036 | } |
| 1037 | |
| 1038 | // itob returns an 8-byte big endian representation of v. |
| 1039 | func itob(v int64) []byte { |