Friday, August 18, 2017

From the "I'm overthinking this department"

Our current application framework uses bootstrap to get a lot of values for each environment (dev, test, prod).  All these values are read at the start of the application.

I have written a "Data Retrieval" app to get data from all the environments, so the data from whatever source can be manually verified with what's in our databases.  One of the features I wanted was to be able to switch environments while staying in the app, since it requires editing a config file, and then reloading the config.

A few hours of trying different incantations of commands trying to convince our app framework to reload itself.  Then suddenly it dawned on me.  Why not have the entire app restart, after all that's what I wanted to.  5 minutes after I got in the office and my problem was solved.  In this case an "Application.Restart()" command did everything I wanted.

An "extra credit" assignment would be to have it save it's state for the new instance of the app to use.  In this case, just the email email address to use for the query, though I'm not sure how useful it would be for anyone who isn't testing the data retrieval app itself [very unlikely you would be searching for the email address across environments].

No comments:

Post a Comment