Stop shuts down the checkpoint scheduler, waits for any in-progress checkpoint to finish, and closes the database connection.
()
| 104 | // Stop shuts down the checkpoint scheduler, waits for any in-progress |
| 105 | // checkpoint to finish, and closes the database connection. |
| 106 | func (c *DuckLakeCheckpointer) Stop() { |
| 107 | if c == nil { |
| 108 | return |
| 109 | } |
| 110 | c.stopOnce.Do(func() { |
| 111 | close(c.done) |
| 112 | <-c.loopDone |
| 113 | if c.db != nil { |
| 114 | _ = c.db.Close() |
| 115 | } |
| 116 | }) |
| 117 | } |
| 118 | |
| 119 | func (c *DuckLakeCheckpointer) loop() { |
| 120 | defer close(c.loopDone) |