MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Shutdown

Method Shutdown

worker/db.go:347–383  ·  view source on GitHub ↗

Shutdown stop database handles and stop service the database.

()

Source from the content-addressed store, hash-verified

345
346// Shutdown stop database handles and stop service the database.
347func (db *Database) Shutdown() (err error) {
348 if db.kayakRuntime != nil {
349 // shutdown, stop kayak
350 if err = db.kayakRuntime.Shutdown(); err != nil {
351 return
352 }
353
354 // unregister
355 db.mux.unregister(db.dbID)
356 }
357
358 if db.kayakWal != nil {
359 // shutdown, stop kayak
360 db.kayakWal.Close()
361 }
362
363 if db.chain != nil {
364 // stop chain
365 if err = db.chain.Stop(); err != nil {
366 return
367 }
368 }
369
370 if db.connSeqEvictCh != nil {
371 // stop connection sequence evictions
372 select {
373 case _, ok := <-db.connSeqEvictCh:
374 if ok {
375 close(db.connSeqEvictCh)
376 }
377 default:
378 close(db.connSeqEvictCh)
379 }
380 }
381
382 return
383}
384
385// Destroy stop database instance and destroy all data/meta.
386func (db *Database) Destroy() (err error) {

Callers 4

CreateMethod · 0.95
DestroyMethod · 0.95
TestSingleDatabaseFunction · 0.95
NewDatabaseFunction · 0.45

Calls 3

CloseMethod · 0.65
unregisterMethod · 0.45
StopMethod · 0.45

Tested by 1

TestSingleDatabaseFunction · 0.76