From 51b6fc0dde431b6489e5ceb26a6e0cc2c66c6b51 Mon Sep 17 00:00:00 2001 From: lash Date: Sat, 4 Jan 2025 21:13:39 +0000 Subject: [PATCH] Remove unused methods in storage interfaces, improve logs --- cmd/africastalking/main.go | 4 ++-- cmd/async/main.go | 2 +- cmd/http/main.go | 2 +- cmd/main.go | 2 +- common/storage.go | 1 - devtools/store/main.go | 2 ++ internal/storage/storageservice.go | 1 - 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 0d2b8ec..40c3609 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -47,7 +47,7 @@ func main() { var err error flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") - flag.StringVar(&connStr, "c", ".state", "connection string") + flag.StringVar(&connStr, "c", "", "connection string") flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host") @@ -63,7 +63,7 @@ func main() { os.Exit(1) } - logg.Infof("start command", "build", build, "dbdir", connStr, "resourcedir", resourceDir, "outputsize", size) + logg.Infof("start command", "build", build, "conn", connData, "resourcedir", resourceDir, "outputsize", size) ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) diff --git a/cmd/async/main.go b/cmd/async/main.go index 65e681d..b0c7caa 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -74,7 +74,7 @@ func main() { os.Exit(1) } - logg.Infof("start command", "connstr", connStr, "resourcedir", resourceDir, "outputsize", size, "sessionId", sessionId) + logg.Infof("start command", "conn", connData, "resourcedir", resourceDir, "outputsize", size, "sessionId", sessionId) ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) diff --git a/cmd/http/main.go b/cmd/http/main.go index 2f043e6..d744afc 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -62,7 +62,7 @@ func main() { os.Exit(1) } - logg.Infof("start command", "connstr", connStr, "resourcedir", resourceDir, "outputsize", size) + logg.Infof("start command", "conn", connData, "resourcedir", resourceDir, "outputsize", size) ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) diff --git a/cmd/main.go b/cmd/main.go index ad4535b..ac680fc 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -52,7 +52,7 @@ func main() { os.Exit(1) } - logg.Infof("start command", "connstr", connStr, "outputsize", size) + logg.Infof("start command", "conn", connData, "outputsize", size) ctx := context.Background() ctx = context.WithValue(ctx, "SessionId", sessionId) diff --git a/common/storage.go b/common/storage.go index c7e478b..2960578 100644 --- a/common/storage.go +++ b/common/storage.go @@ -23,7 +23,6 @@ type StorageServices interface { GetPersister(ctx context.Context) (*persist.Persister, error) GetUserdataDb(ctx context.Context) (db.Db, error) GetResource(ctx context.Context) (resource.Resource, error) - SetConn(conn storage.ConnData) } type StorageService struct { diff --git a/devtools/store/main.go b/devtools/store/main.go index f7f76c6..6915f74 100644 --- a/devtools/store/main.go +++ b/devtools/store/main.go @@ -48,6 +48,8 @@ func main() { os.Exit(1) } + logg.Infof("start command", "conn", connData) + ctx := context.Background() ctx = context.WithValue(ctx, "SessionId", sessionId) ctx = context.WithValue(ctx, "Database", database) diff --git a/internal/storage/storageservice.go b/internal/storage/storageservice.go index 9148d7c..83ce051 100644 --- a/internal/storage/storageservice.go +++ b/internal/storage/storageservice.go @@ -23,7 +23,6 @@ type StorageService interface { GetPersister(ctx context.Context) (*persist.Persister, error) GetUserdataDb(ctx context.Context) db.Db GetResource(ctx context.Context) (resource.Resource, error) - SetConn(connStr string) error } type MenuStorageService struct {