Closed Lucas-W closed 7 years ago
MongoDB currently has to be running before Node, running after will not get the system working -- Closing MongoDB once Node is running and then running it again doesn't always return the site to normal
Set timeout loop to attempt to connect to MongoDB every 5 seconds if the first connection attempt fails. If an error occurs or the DB is shutdown after the server has made it's first successful connection, Mongoose will reconnect automatically when possible.
Switching some nav tabs doesn't work while there's no communication to the database and gives no feedback to the User.
Should work okay now, was getting hung up because the server was not responding with any response if there was no connection to the DB, now checks the DB connection status on all DB related API requests and responds with an error if the DB is not connected.
Spinning wheel is uninformative to the User -- Differentiate between normal ~0.25 second loading and 'Database is taking a long time / Not on'
All the loading overlays should now stop when the API request is returned successfully or unsuccessfully.
Should work okay now, was getting hung up because the server was not responding with any response if there was no connection to the DB, now checks the DB connection status on all DB related API requests and responds with an error if the DB is not connected.
Moved this check to a middleware function that can be added to the appropriate requests. This function is executed after the authentication function and checks the database connection status. If 'connected' the next function is executed, otherwise, an error is returned to notify the user.