You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if the Redis server isn't available, the redis client throws an error and since this error is unhandled, it crashes the Nodejs server.
This is by design (a good thing) since the Redis store is used as the primary storage for shortened urls. So if the Redis server isn't available, the app can't work.
But when introducing a database, we'll want to avoid those crashes (handle the errors) since the database will now be the primary storage and the Redis store will be just a caching layer.
The current error logger has Sentry an application monitoring and error tracking software integrated into it so the error handler can log the errors as level error which is an high enough level to notify me.
Meanwhile a retry strategy could be implemented to retry establishing connections with the Redis server.
Also on redis client connection to the Redis server, the Redis server should be pinged periodically to prevent an idle connection timeout from closing the connection. The connection timeout is by default 1 hour.
The text was updated successfully, but these errors were encountered:
Since we're going to setup a database as a primary data persistence, Redis won't be needed a primary memory store but just as a caching layer. So all redis connection errors are handled to prevent the errors from crashing the Nodejs server
* configure a retry strategy for redis client when connection to Redis server is unavailable
* ping Redis server every 60 minutes to prevent an idle connection timeout
* add event listeners to redis client for basic logging
* set log level to emergency on Nodejs server crashes
* add redis client names for Nodejs connection to Redis server and rate-limit store connection to Redis server
* format Redis connection errors to be more verbose and readable
Resolves#38
Currently if the Redis server isn't available, the redis client throws an error and since this error is unhandled, it crashes the Nodejs server.
This is by design (a good thing) since the Redis store is used as the primary storage for shortened urls. So if the Redis server isn't available, the app can't work.
But when introducing a database, we'll want to avoid those crashes (handle the errors) since the database will now be the primary storage and the Redis store will be just a caching layer.
The current error logger has Sentry an application monitoring and error tracking software integrated into it so the error handler can log the errors as level
error
which is an high enough level to notify me.Meanwhile a retry strategy could be implemented to retry establishing connections with the Redis server.
Also on redis client connection to the Redis server, the Redis server should be pinged periodically to prevent an
idle connection timeout
from closing the connection. The connection timeout is by default 1 hour.The text was updated successfully, but these errors were encountered: