From 212cd482498ff25b7a652eaf9f1346f2808fcbd3 Mon Sep 17 00:00:00 2001 From: Mohammed Sohail Date: Tue, 19 Nov 2024 17:53:06 +0300 Subject: [PATCH] debug: postgres conn string --- Dockerfile | 2 +- internal/storage/storageservice.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 64ff175..3a5da7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ RUN make VISE_PATH=/build/go-vise -B WORKDIR /build RUN echo "Building on $BUILDPLATFORM, building for $TARGETPLATFORM" RUN go mod download -RUN go build -o ussd-africastalking -ldflags="-X main.build=${BUILD} -s -w" cmd/africastalking/main.go +RUN go build -tags logtrace -o ussd-africastalking -ldflags="-X main.build=${BUILD} -s -w" cmd/africastalking/main.go FROM debian:bookworm-slim diff --git a/internal/storage/storageservice.go b/internal/storage/storageservice.go index 9fa1839..ca28bbb 100644 --- a/internal/storage/storageservice.go +++ b/internal/storage/storageservice.go @@ -41,10 +41,13 @@ func buildConnStr() string { dbName := initializers.GetEnv("DB_NAME", "") port := initializers.GetEnv("DB_PORT", "5432") - return fmt.Sprintf( + connString := fmt.Sprintf( "postgres://%s:%s@%s:%s/%s", user, password, host, port, dbName, ) + logg.Debugf("pg conn string", "conn", connString) + + return connString } func NewMenuStorageService(dbDir string, resourceDir string) *MenuStorageService {