From 07806c694269f6226a0f42c9f2cfb8c7655afad9 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 7 May 2022 14:56:34 -0600 Subject: Move sql db out of post.NewStore, so it can be shared --- srv/src/cmd/import-posts/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'srv/src/cmd/import-posts/main.go') diff --git a/srv/src/cmd/import-posts/main.go b/srv/src/cmd/import-posts/main.go index 6a1e952..e4eb9e7 100644 --- a/srv/src/cmd/import-posts/main.go +++ b/srv/src/cmd/import-posts/main.go @@ -133,13 +133,13 @@ func main() { logger.FatalString(ctx, "no paths given") } - postStore, err := post.NewStore(post.StoreParams{ - DataDir: dataDir, - }) + postDB, err := post.NewSQLDB(dataDir) if err != nil { - logger.Fatal(ctx, "initializing post store", err) + logger.Fatal(ctx, "initializing post sql db", err) } - defer postStore.Close() + defer postDB.Close() + + postStore := post.NewStore(postDB) for _, path := range *paths { -- cgit v1.2.3