MCPcopy
hub / github.com/pocketbase/pocketbase / ResetBootstrapState

Method ResetBootstrapState

core/base.go:451–480  ·  view source on GitHub ↗

ResetBootstrapState releases the initialized core app resources (closing db connections, stopping cron ticker, etc.).

()

Source from the content-addressed store, hash-verified

449// ResetBootstrapState releases the initialized core app resources
450// (closing db connections, stopping cron ticker, etc.).
451func (app *BaseApp) ResetBootstrapState() error {
452 app.Cron().Stop()
453
454 var errs []error
455
456 dbs := []*dbx.Builder{
457 &app.concurrentDB,
458 &app.nonconcurrentDB,
459 &app.auxConcurrentDB,
460 &app.auxNonconcurrentDB,
461 }
462
463 for _, db := range dbs {
464 if db == nil {
465 continue
466 }
467 if v, ok := (*db).(closer); ok {
468 if err := v.Close(); err != nil {
469 errs = append(errs, err)
470 }
471 }
472 *db = nil
473 }
474
475 if len(errs) > 0 {
476 return errors.Join(errs...)
477 }
478
479 return nil
480}
481
482// DB returns the default app data.db builder instance.
483//

Calls 3

CronMethod · 0.95
StopMethod · 0.80
CloseMethod · 0.65