From 84422684c5d196cc20201c35b445fe9d99466d81 Mon Sep 17 00:00:00 2001 From: lash Date: Sun, 22 Sep 2024 02:33:11 +0100 Subject: [PATCH] Rehabilitate all executables --- cmd/africastalking/main.go | 6 ++---- cmd/async/main.go | 5 ++--- cmd/http/main.go | 7 +++---- cmd/main.go | 2 +- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 3e17d81..6c19aa3 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -98,9 +98,7 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) - rs, err := menuStorageService.GetResource(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) @@ -113,7 +111,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -126,7 +124,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) diff --git a/cmd/async/main.go b/cmd/async/main.go index 8d50e4a..fbcf9d8 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -71,7 +71,6 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) rs, err := menuStorageService.GetResource(ctx) if err != nil { @@ -85,7 +84,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -98,7 +97,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) hl, err := lhs.GetHandler() if err != nil { diff --git a/cmd/http/main.go b/cmd/http/main.go index a9e7d00..9c24a55 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -59,7 +59,6 @@ func main() { cfg.EngineDebug = true } - resourceDir := scriptDir menuStorageService := storage.NewMenuStorageService(dbDir, resourceDir) rs, err := menuStorageService.GetResource(ctx) if err != nil { @@ -73,7 +72,7 @@ func main() { os.Exit(1) } - userdataStore := menuStorageService.GetUserdataDb(ctx) + userdataStore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) @@ -86,7 +85,7 @@ func main() { } lhs, err := handlers.NewLocalHandlerService(pfp, true, dbResource, cfg, rs) - lhs.WithDataStore(&userdataStore) + lhs.SetDataStore(&userdataStore) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) @@ -99,7 +98,7 @@ func main() { os.Exit(1) } - stateStore, err := menuStorageService.GetStateStore(dbDir, ctx) + stateStore, err := menuStorageService.GetStateStore(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1) diff --git a/cmd/main.go b/cmd/main.go index 2a2f896..bd3d634 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -64,7 +64,7 @@ func main() { os.Exit(1) } - userdatastore := menuStorageService.GetUserdataDb(ctx) + userdatastore, err := menuStorageService.GetUserdataDb(ctx) if err != nil { fmt.Fprintf(os.Stderr, err.Error()) os.Exit(1)