Spaces:
Runtime error
Runtime error
ChartDB Admin commited on
Commit ยท
eb4c78b
1
Parent(s): f506bb0
Add debug logging for MONGO_URI
Browse files- cmd/main.go +13 -0
cmd/main.go
CHANGED
|
@@ -35,6 +35,19 @@ func main() {
|
|
| 35 |
consoleLog.PrintBanner(false)
|
| 36 |
consoleLog.Info("Mode: Timestamp-triggered processing with parallel workers")
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
// Create context with signal handling
|
| 39 |
ctx, cancel := context.WithCancel(context.Background())
|
| 40 |
defer cancel()
|
|
|
|
| 35 |
consoleLog.PrintBanner(false)
|
| 36 |
consoleLog.Info("Mode: Timestamp-triggered processing with parallel workers")
|
| 37 |
|
| 38 |
+
// Debug: Check if MONGO_URI is set
|
| 39 |
+
mongoURI := cfg.MongoURI
|
| 40 |
+
if mongoURI == "" || mongoURI == "mongodb://localhost:27017" {
|
| 41 |
+
consoleLog.Warn("MONGO_URI not set or using default - check your secrets!")
|
| 42 |
+
} else {
|
| 43 |
+
// Mask the URI for logging (show first 20 chars only)
|
| 44 |
+
masked := mongoURI
|
| 45 |
+
if len(masked) > 30 {
|
| 46 |
+
masked = masked[:30] + "..."
|
| 47 |
+
}
|
| 48 |
+
consoleLog.Info("MONGO_URI detected: %s", masked)
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
// Create context with signal handling
|
| 52 |
ctx, cancel := context.WithCancel(context.Background())
|
| 53 |
defer cancel()
|