Close closes the SQLite persistence handle.
()
| 120 | |
| 121 | // Close closes the SQLite persistence handle. |
| 122 | func Close() error { |
| 123 | globalStore.mu.Lock() |
| 124 | defer globalStore.mu.Unlock() |
| 125 | if globalStore.db == nil { |
| 126 | return nil |
| 127 | } |
| 128 | err := globalStore.db.Close() |
| 129 | globalStore.db = nil |
| 130 | globalStore.dbPath = "" |
| 131 | return err |
| 132 | } |
| 133 | |
| 134 | // ResetForTest clears the process-local cache. |
| 135 | func ResetForTest() { |