fix: address review comments
CI / verify (pull_request) Successful in 4m16s

This commit is contained in:
2026-09-25 11:46:02 +03:00
parent 09779a53ae
commit 6d5ac9e81d
26 changed files with 683 additions and 666 deletions
+4 -5
View File
@@ -54,7 +54,7 @@ func main() {
}
func run() error {
urlFile := flag.String("database-url-file", "secrets/database_url", "file containing the PostgreSQL URL")
databaseURL := flag.String("database-url", os.Getenv("DATABASE_URL"), "PostgreSQL URL")
output := flag.String("output", "evidence/lab2-track2.json", "result JSON path")
messages := flag.Int("messages", 100000, "number of messages")
writeRows := flag.Int("write-rows", 10000, "rows per write test")
@@ -66,11 +66,10 @@ func run() error {
return fmt.Errorf("write-rows must be at least 1000")
}
data, err := os.ReadFile(*urlFile)
if err != nil {
return fmt.Errorf("read database URL: %w", err)
if strings.TrimSpace(*databaseURL) == "" {
return fmt.Errorf("database URL is required")
}
pool, err := pgxpool.New(context.Background(), strings.TrimSpace(string(data)))
pool, err := pgxpool.New(context.Background(), strings.TrimSpace(*databaseURL))
if err != nil {
return fmt.Errorf("open database: %w", err)
}