[FLY] Fix an issue related to `.env` files (#173)

Fix an issue in which fly was not correctly populating the `P2P_NETWORK`
variable from an `.env` file.
This commit is contained in:
agodnic 2023-03-06 14:36:14 -03:00 committed by GitHub
parent c1dea6ea4d
commit f169af3d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -164,6 +164,11 @@ func newVAANotifierFunc(isLocal bool, logger *zap.Logger) processor.VAANotifyFun
}
func main() {
//TODO: use a configuration structure to obtain the configuration
if err := godotenv.Load(); err != nil {
fmt.Println("No .env file found")
}
// Node's main lifecycle context.
rootCtx, rootCtxCancel = context.WithCancel(context.Background())
defer rootCtxCancel()
@ -200,11 +205,7 @@ func main() {
logger.Fatal("Please specify --bootstrap")
}
//TODO: use a configuration structure to obtain the configuration
// Setup DB
if err := godotenv.Load(); err != nil {
logger.Info("No .env file found")
}
uri := os.Getenv("MONGODB_URI")
if uri == "" {
logger.Fatal("You must set your 'MONGODB_URI' environmental variable. See\n\t https://www.mongodb.com/docs/drivers/go/current/usage-examples/#environment-variable")