refactor(internal): replace log.Fatal with panic, add timezone to DSN, add empty S3 bucket check
Replace log.Fatal in dev service init with panic for consistency. Add timezone=UTC to DAV connection DSN. Add IsEmpty() check for S3 dev bucket. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -6,7 +6,6 @@ package dav
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
@@ -20,13 +19,13 @@ func init() {
|
||||
if os.Getenv("GO_TESTING") != "" {
|
||||
return
|
||||
}
|
||||
log.Fatalf("failed to initialize dev service: %v", err)
|
||||
panic("failed to initialize dev service: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func connect() error {
|
||||
dsn := fmt.Sprintf(
|
||||
"postgres://%s:%s@localhost:5432/%s?sslmode=disable&require_auth=scram-sha-256",
|
||||
"postgres://%s:%s@localhost:5432/%s?sslmode=disable&timezone=UTC&require_auth=scram-sha-256",
|
||||
getEnv("POSTGRES_USER"),
|
||||
getEnv("POSTGRES_PASSWORD"),
|
||||
getEnv("POSTGRES_DB"),
|
||||
|
||||
Reference in New Issue
Block a user