feat: 实现 SQLite 迁移备份、完整表结构与简单写入队列
This commit is contained in:
+1
-5
@@ -35,16 +35,12 @@ func runServe(ctx context.Context, cfg config.Config) error {
|
||||
return fmt.Errorf("mkdir data_dir: %w", err)
|
||||
}
|
||||
|
||||
db, err := store.OpenWriter(cfg.DataDir, cfg.SQLiteSynchronous)
|
||||
db, err := store.Open(cfg.DataDir, cfg.SQLiteSynchronous)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() { _ = db.Close() }()
|
||||
|
||||
if migErr := store.Migrate(db); migErr != nil {
|
||||
return migErr
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, _ *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
Reference in New Issue
Block a user