INNER CODE UNIT · Go

Shutdown

OpenListTeam/OpenList-Mobile · openlist-lib/openlistlib/server.go:64

func Shutdown(timeout int64) (err error) {
	timeoutDuration := time.Duration(timeout) * time.Millisecond
	bootstrap.Shutdown(timeoutDuration)

	// Force database sync before shutdown
	ForceDBSync()
	//bootstrap.Release()
	return nil
}

// ForceDBSync forces SQLite WAL checkpoint to sync data to main database file
func ForceDBSync() error {
	log.Info("Forcing database sync (WAL checkpoint)...")

	// Get the database instance and execute WAL checkpoint
	gormDB := db.GetDb()
	if gormDB != nil {
		sqlDB, err := gormDB.DB()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…