This commit is contained in:
@@ -19,6 +19,13 @@ func main() {
|
||||
mongoURI := getEnv("MONGO_URI", "mongodb://localhost:27017")
|
||||
dbName := getEnv("MONGO_DB", "vantage")
|
||||
|
||||
// Agents dial gRPC directly, so there is no sane default: falling back to the
|
||||
// public web host would hand every new agent a config pointing at a port that
|
||||
// does not speak gRPC. Fail loudly at boot instead of at install time.
|
||||
if os.Getenv("GRPC_HOST") == "" {
|
||||
log.Fatal("GRPC_HOST is required (host:port agents dial for gRPC)")
|
||||
}
|
||||
|
||||
if err := db.Connect(mongoURI, dbName); err != nil {
|
||||
log.Fatalf("failed to connect to MongoDB: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user